Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
heap_min_block_size(3) Guardian Native C Library Calls Reference Manual
NAME
heap_min_block_size - Specifies the minimum block size to attempt to use when allocating
from the heap
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdlib.h>
void heap_min_block_size (
long min_block_size);
PARAMETERS
min_block_size Specifies the number of bytes to be allocated.
DESCRIPTION
The heap_min_block_size() function specifies to the run-time library the minimum block size to
attempt to use when an allocation is made from the heap. If a larger block size is required than
the minimum specified block size, the minimum value is ignored.
If a program makes many calls to the the memory-management functions calloc(), free(), mal-
loc(), and realloc() to allocate and deallocate small blocks of memory and these calls are inter-
spersed with many calls to allocate large blocks of memory, the heap can become very frag-
mented with many small, almost useless free blocks. This memory configuration can have a
detrimental effect on the run-time efficiency of the routines that traverse the "free-list" searching
for a block of memory of the proper size to allocate. By judiciously choosing a value for
heap_min_block_size(), you can tune the performance of your program.
RELATED INFORMATION
Functions: heap_check(3), heap_check_always(3).
STANDARDS CONFORMANCE
The heap_min_block_size() function is an HP extension to the XPG4 Version 2 specification.
3−84 Hewlett-Packard Company 527192-018