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

Function zmalloc_size

src/zmalloc.cpp:285–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 * information as the first bytes of every allocation. */
284#ifndef HAVE_MALLOC_SIZE
285size_t zmalloc_size(void *ptr) {
286 void *realptr = (char*)ptr-PREFIX_SIZE;
287 size_t size = *((size_t*)realptr);
288 return size+PREFIX_SIZE;
289}
290size_t zmalloc_usable_size(void *ptr) {
291 return zmalloc_size(ptr)-PREFIX_SIZE;
292}

Callers 15

ztrymalloc_usableFunction · 0.85
zmalloc_no_tcacheFunction · 0.85
zfree_no_tcacheFunction · 0.85
ztrycalloc_usableFunction · 0.85
ztryrealloc_usableFunction · 0.85
zmalloc_usable_sizeFunction · 0.85
zfreeFunction · 0.85
zfree_usableFunction · 0.85
objectComputeSizeFunction · 0.85
getMemoryOverheadDataFunction · 0.85
activeDefragAllocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected