Giter Club home page Giter Club logo

learn-go's Introduction

go-learn

golang study

int 和 int32 的区别

go 官方文档说明 https://golang.org/pkg/builtin/#int32

int is a signed integer type that is at least 32 bits in size.It is a distinct type,not an alias for int32

SDS(Simple Dynamic String):

  • buf 实际数据
  • len 已使用长度 4 字节
  • alloc 分配的长度 alloc >= len 4字节

redis string 内存布局(SDS+RedisObject):

  • Long 类型整数,RedisObject 指针直接赋值为整数数据
  • 保存字符串数据,字符数据小于 44 字节,RedisObject 跟 SDS 连续分布
  • 大于 44 字节,
  • 元数据 8 字节
  • 指针 指向 dicEntry 8 字节
  • dicEntry

learn-go's People

Contributors

ltinyho avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.