MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ziplistSafeToAdd

Function ziplistSafeToAdd

app/redis-6.2.6/src/ziplist.c:273–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271 * zlbytes*/
272#define ZIPLIST_MAX_SAFETY_SIZE (1<<30)
273int ziplistSafeToAdd(unsigned char* zl, size_t add) {
274 size_t len = zl? ziplistBlobLen(zl): 0;
275 if (len + add > ZIPLIST_MAX_SAFETY_SIZE)
276 return 0;
277 return 1;
278}
279
280
281/* We use this function to receive information about a ziplist entry.

Callers 4

hashTypeTryConversionFunction · 0.85
rdbLoadObjectFunction · 0.85
zsetAddFunction · 0.85

Calls 1

ziplistBlobLenFunction · 0.85

Tested by

no test coverage detected