MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / intsetResize

Function intsetResize

src/intset.c:106–111  ·  view source on GitHub ↗

Resize the intset */

Source from the content-addressed store, hash-verified

104
105/* Resize the intset */
106static intset *intsetResize(intset *is, uint32_t len) {
107 uint64_t size = (uint64_t)len*intrev32ifbe(is->encoding);
108 assert(size <= SIZE_MAX - sizeof(intset));
109 is = zrealloc(is,sizeof(intset)+size, MALLOC_SHARED);
110 return is;
111}
112
113/* Search for the position of "value". Return 1 when the value was found and
114 * sets "pos" to the position of the value within the intset. Return 0 when

Callers 3

intsetUpgradeAndAddFunction · 0.85
intsetAddFunction · 0.85
intsetRemoveFunction · 0.85

Calls 1

zreallocFunction · 0.85

Tested by

no test coverage detected