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

Function zmalloc_size

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

Source from the content-addressed store, hash-verified

271 * information as the first bytes of every allocation. */
272#ifndef HAVE_MALLOC_SIZE
273size_t zmalloc_size(void *ptr) {
274 void *realptr = (char*)ptr-PREFIX_SIZE;
275 size_t size = *((size_t*)realptr);
276 return size+PREFIX_SIZE;
277}
278size_t zmalloc_usable_size(void *ptr) {
279 return zmalloc_size(ptr)-PREFIX_SIZE;
280}

Callers 15

activeDefragAllocFunction · 0.85
objectComputeSizeFunction · 0.85
getMemoryOverheadDataFunction · 0.85
sdsZmallocSizeFunction · 0.85
catClientInfoStringFunction · 0.85
RM_MallocSizeFunction · 0.85
ztrymalloc_usableFunction · 0.85
zmalloc_no_tcacheFunction · 0.85
zfree_no_tcacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected