dfree — dmalloc API manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | STANDARDS | NOTES

dfree                     dmalloc API functions manual                     dfree

NAME         top

        dfree - deallocates memory.

SYNOPSIS         top

        #include "dmalloc.h"

        void dfree(void *p, darena_t *arena);

DESCRIPTION         top

        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.
        

RETURN VALUE         top

        The dfree() function returns no value and preserves errno.

ERRORS         top

        No errors are defined.

ATTRIBUTES         top

        For an explanation of the terms used in this section, see attributes(7).
        ┌────────────────────────────────────┬───────────────┬───────────┐
        │ InterfaceAttributeValue     │
        ├────────────────────────────────────┼───────────────┼───────────┤
        │ dfree()                            │ Thread safety │ MT-Safe   │
        └────────────────────────────────────┴───────────────┴───────────┘

STANDARDS         top

        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.

NOTES         top

        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