Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-87
_is_system_trap (supplementary)
heap_min_block_size (supplementary)
The heap_min_block_size function suggests to the run-time library what the minimum
block size should be when an allocation is made from the heap.
min_block_size
specifies the number of bytes to be allocated.
Usage Guidelines
•
If a C program makes many calls to the malloc, calloc, or free functions to allocate
and deallocate small blocks of memory and these calls are interspersed with many
calls to allocate large blocks of memory, the heap can become very fragmented 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.
_is_system_trap (supplementary)
The _is_system_trap function can be used in the handler to determine whether the
current trap happens in system code.
Return Value
is zero if the current trap did not happen in system code. Otherwise, the return value
is nonzero, which indicates that the trap did occur in system code. The return value
is undefined if this function is called from a function that is not a signal handler.
#include <stdlibh>
void heap_min_block_size(long min_block_size);
#include <signalh>
sig_atomic_t _is_system_trap(void)