The increment for the break pointer
#include <stdlib.h> unsigned int _amblksiz
The _amblksiz global variable is the basic unit that's used for heap allocations to get memory from the system using mmap(). All underlying mmap() operations made by the heap allocator get memory as multiples of _amblksiz. By default, _amblksiz is set to 8 × PSIZ, or 32 KB. Its value must be a multiple of 4 KB, and currently is limited to being less than 256 KB.
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.
The value of _amblksiz 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.
There are several ways that you can change _amblksiz:
unsigned _amblksiz = 8*PSIZ;
No checking is done, but the value specified here must be a multiple of 4 KB. You can reset _amblksiz to a new value at any time, and this takes effect from that point onwards.
|It isn't safe for a multithreaded program to dynamically change this value. Multithreaded applications should set this value as a global at compile time, and use the below mechanisms for safely manipulating _amblksiz.|
If size is specified as zero, mallopt() returns the current value of _amblksiz.
malloc(), mallopt(), mmap()
The Heap Analysis: Making Memory Errors a Thing of the Past chapter of the Neutrino Programmer's Guide.