MCPcopy Create free account
hub / github.com/antirez/botlib / sdsHdrSize

Function sdsHdrSize

sds.c:44–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42const char *SDS_NOINIT = "SDS_NOINIT";
43
44static inline int sdsHdrSize(char type) {
45 switch(type&SDS_TYPE_MASK) {
46 case SDS_TYPE_5:
47 return sizeof(struct sdshdr5);
48 case SDS_TYPE_8:
49 return sizeof(struct sdshdr8);
50 case SDS_TYPE_16:
51 return sizeof(struct sdshdr16);
52 case SDS_TYPE_32:
53 return sizeof(struct sdshdr32);
54 case SDS_TYPE_64:
55 return sizeof(struct sdshdr64);
56 }
57 return 0;
58}
59
60static inline char sdsReqType(size_t string_size) {
61 if (string_size < 1<<5)

Callers 6

sdsnewlenFunction · 0.85
sdsfreeFunction · 0.85
sdsMakeRoomForFunction · 0.85
sdsRemoveFreeSpaceFunction · 0.85
sdsAllocSizeFunction · 0.85
sdsAllocPtrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected