_uclose -- Close Heap from Use

Format

#include <umalloc.h>
int _uclose(Heap_t heap);

Language Level: Extension
_uclose closes a heap when a process will not use it again. After you close a heap, any attempt in the current process to allocate or return memory to it will have undefined results. _uclose affects only the current process; if the heap is shared, other processes may still be able to access it.

Once you have closed the heap, use _udestroy to destroy it and return all its memory to the operating system.

Note: If the heap is shared, you must close it in all processes that share it before you destroy it, or undefined results will occur.

You cannot close the IBM C and C++ Compilers runtime heap (_RUNTIME_HEAP).

Return Value
If successful, _uclose returns 0. A nonzero return value indicates failure. Passing _uclose a heap that is not valid results in undefined behavior.

Example



Memory Management


_uopen -- Open Heap for Use
_udestroy -- Destroy a Heap
_ucreate -- Create a Memory Heap
<umalloc.h>