darenadestroy — dmalloc API manual page

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

darenadestroy             dmalloc API functions manual             darenadestroy

NAME         top

        darenadestroy - destroys an arena.

SYNOPSIS         top


        #include "dmalloc.h"

        int darenadestroy(darena_t *arena);

DESCRIPTION         top

        The function darenastroy() destroys the arena pointed to by arena. If
        arena is NULL, darenadestroy() just returns 0. arena must be a pointer
        to an arena previously initialized by darenainit(). If not, it causes
        undefined behaviour.
    

RETURN VALUE         top

        On success, darenadestroy() returns 0. On failure, it returns -1, and
        sets errno.

ERRORS         top

        darenadestroy() can only fail in multi-threaded applications with one of
        the following errors:

        EBUSY   Device or resource busy. darenadestroy() was called upon an
                arena owned by another thread.

        EINVAL  Invalid argument. darenadestroy() was called upon an arena that
                had not been properly initialized.

ATTRIBUTES         top

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

STANDARDS         top

        None.

NOTES         top

        It is not mandatory to destroy an arena at the end of an application,
        especially in a single threaded one. However, it is necessary in
        multi-threaded applications, when the one intends to reuse the backing
        memory that had been initialized to that arena.
dmalloc API functions manual       2026-04-13                      darenadestroy