QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
The increment for the break pointer
#include <stdlib.h> unsigned int _amblksiz
The _amblksiz global variable holds the increment by which the "break" pointer for memory allocation is advanced when there's no freed block large enough to satisfy a request to allocate a block of memory. You can change this at any time.
This variable represents the unit size that will be used to ask for memory from the system when a core allocation needs to be made. Core allocations are made from the system by using the mmap() call. In the current implementation of the allocator, requests for memory larger than 32 KB are automatically serviced by calling mmap() directly, while smaller allocations are serviced by a split-coalesce mechanism inside the allocator.
Setting this value affects all allocations that are smaller than 32 KB and require a core allocation. Memory that has become free will eventually return to the system when all memory associated with a specific core allocation has been released back to the allocator. Even when a block has been fully released to the allocator, it's possible for the allocator, for efficiency purposes, to retain some blocks locally within the heap (without releasing memory to the system immediately). This is done to avoid thrashing behavior, when requests to allocate and free memory cause the the allocator to constantly request and release memory to and from the system.
The Heap Analysis: Making Memory Errors a Thing of the Past chapter of the Neutrino Programmer's Guide.