Initializes a new heap to be used with kernel memory management services.
#include <sys/types.h> #include <sys/errno.h> #include <sys/xmalloc.h> #include <sys/malloc.h>
heapaddr_t init_heap (area, size, heapp) caddr_t area; int size; heapaddr_t *heapp;
The init_heap kernel service is most commonly used by a kernel process to initialize and manage an area of virtual memory as a private heap. Once this service creates a private heap, the returned heapaddr_t value can be used with the xmalloc or xmfree service to allocate or deallocate memory from the private heap. Heaps can be created within other heaps, a kernel process private region, or even on a stack.
Few kernel extensions ever require the init_heap service because the exported global kernel_heap and pinned_heap are normally used for memory allocation within the kernel. However, kernel processes can use the init_heap service to create private nonglobal heaps within their process private region for controlling kernel access to the heap and possibly for performance considerations.
The init_heap kernel service can be called from the process environment only.
The init_heap kernel service is part of Base Operating System (BOS) Runtime.
The xmalloc kernel service, xmfree kernel service.
Memory Kernel Services and Using Kernel Processes in AIX Kernel Extensions and Device Support Programming Concepts.