Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

_amblksiz

_amblksiz controls memory heap granularity. It is declared in MALLOC.H as

extern unsigned int _amblksiz;

The value of _amblksiz specifies the size of blocks allocated by the operating system for the heap. The initial requested size for a segment of heap memory is just enough to satisfy the current allocation request (for example, a call to malloc) plus memory required for heap manager overhead. The value of _amblksiz should represent a trade-off between the number of times the operating system is to be called to increase the heap to required size and the amount of memory potentially wasted (available but not used) at the end of the heap.

The default value of _amblksiz is 8K. You can change this value by direct assignment in your program. For example:

_amblksiz = 2045;

If you assign a value to _amblksiz, the actual value used internally by the heap manager is the assigned value rounded up to the nearest whole power of 2. Thus, in the previous example, the heap manager would reset the value of _amblksize to 2048.

See Also

Global Variables

Show:
© 2015 Microsoft