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

Function sdsAllocSize

sds.c:299–302  ·  view source on GitHub ↗

Return the total size of the allocation of the specified sds string, * including: * 1) The sds header before the pointer. * 2) The string. * 3) The free buffer at the end if any. * 4) The implicit null term. */

Source from the content-addressed store, hash-verified

297 * 4) The implicit null term.
298 */
299size_t sdsAllocSize(sds s) {
300 size_t alloc = sdsalloc(s);
301 return sdsHdrSize(s[-1])+alloc+1;
302}
303
304/* Return the pointer of the actual SDS allocation (normally SDS strings
305 * are referenced by the start of the string buffer). */

Callers

nothing calls this directly

Calls 2

sdsallocFunction · 0.85
sdsHdrSizeFunction · 0.85

Tested by

no test coverage detected