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

Function sdsReqType

sds.c:60–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static inline char sdsReqType(size_t string_size) {
61 if (string_size < 1<<5)
62 return SDS_TYPE_5;
63 if (string_size < 1<<8)
64 return SDS_TYPE_8;
65 if (string_size < 1<<16)
66 return SDS_TYPE_16;
67#if (LONG_MAX == LLONG_MAX)
68 if (string_size < 1ll<<32)
69 return SDS_TYPE_32;
70 return SDS_TYPE_64;
71#else
72 return SDS_TYPE_32;
73#endif
74}
75
76/* Create a new sds string with the content specified by the 'init' pointer
77 * and 'initlen'.

Callers 3

sdsnewlenFunction · 0.85
sdsMakeRoomForFunction · 0.85
sdsRemoveFreeSpaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected