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

Function free_dbg

freebsd/kern/kern_malloc.c:829–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827
828#ifdef MALLOC_DEBUG
829static int
830free_dbg(void **addrp, struct malloc_type *mtp)
831{
832 void *addr;
833
834 addr = *addrp;
835 KASSERT(mtp->ks_version == M_VERSION, ("free: bad malloc type version"));
836 KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(),
837 ("free: called with spinlock or critical section held"));
838
839 /* free(NULL, ...) does nothing */
840 if (addr == NULL)
841 return (EJUSTRETURN);
842
843#ifdef DEBUG_MEMGUARD
844 if (is_memguard_addr(addr)) {
845 memguard_free(addr);
846 return (EJUSTRETURN);
847 }
848#endif
849
850#ifdef DEBUG_REDZONE
851 redzone_check(addr);
852 *addrp = redzone_addr_ntor(addr);
853#endif
854
855 return (0);
856}
857#endif
858
859/*

Callers 2

freeFunction · 0.85
zfreeFunction · 0.85

Calls 4

is_memguard_addrFunction · 0.85
memguard_freeFunction · 0.85
redzone_checkFunction · 0.85
redzone_addr_ntorFunction · 0.85

Tested by

no test coverage detected