|
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | STANDARDS | NOTES |
dfree dmalloc API functions manual dfree
dfree - deallocates memory.
#include "dmalloc.h"
void dfree(void *p, darena_t *arena);
The function dfree() deallocates the memory pointed to by p from the
arena pointed to by arena. If arena is NULL, the memory is deallocated
from the heap. If p is NULL, no action occurs. p is not a pointer
returned from dmalloc(), dcalloc(), drealloc() or dreallocarray(), the
behaviour is undefined.
The dfree() function returns no value and preserves errno.
No errors are defined.
For an explanation of the terms used in this section, see attributes(7).
┌────────────────────────────────────┬───────────────┬───────────┐
│ Interface │ Attribute │ Value │
├────────────────────────────────────┼───────────────┼───────────┤
│ dfree() │ Thread safety │ MT-Safe │
└────────────────────────────────────┴───────────────┴───────────┘
dfree() is supposed to behave like free() when dealing with the
heap. For this reason, it follows the POSIX standard on top of the
ISO/IEC 9899:2024 §7.24.3.3 C standard.
Unlike free(), whose behaviour is undefined when called upon an
aready freed pointer, dfree() just returns in that case.
dmalloc API functions manual 2026-04-13 dfree