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

Function zfree

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

Source from the content-addressed store, hash-verified

281#endif
282
283void zfree(void *ptr) {
284#ifndef HAVE_MALLOC_SIZE
285 void *realptr;
286 size_t oldsize;
287#endif
288
289 if (ptr == NULL) return;
290#ifdef HAVE_MALLOC_SIZE
291 update_zmalloc_stat_free(zmalloc_size(ptr));
292 free(ptr);
293#else
294 realptr = (char*)ptr-PREFIX_SIZE;
295 oldsize = *((size_t*)realptr);
296 update_zmalloc_stat_free(oldsize+PREFIX_SIZE);
297 free(realptr);
298#endif
299}
300
301/* Similar to zfree, '*usable' is set to the usable size being freed. */
302void zfree_usable(void *ptr, size_t *usable) {

Callers 15

resetServerSaveParamsFunction · 0.70
stringConfigSetFunction · 0.70
lwFreeCanvasFunction · 0.70
dictRehashFunction · 0.70
dictGenericDeleteFunction · 0.70
dictFreeUnlinkedEntryFunction · 0.70
_dictClearFunction · 0.70
dictReleaseFunction · 0.70
dictReleaseIteratorFunction · 0.70
freeCallbackFunction · 0.70

Calls 2

zmalloc_sizeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected