HP-UX 11i Version 1.5 Release Notes, September 2001

Programming
Changes to libc
Chapter 798
bytes. In general, the more arenas you use, the smaller the expansion
factor should be, and vice versa.
Beginning in HP-UX 11i Version 1.5 (B.11.20), for Itanium-based
systems only, the small block allocator is active by default with the
following configuration:
__maxfast
= 512,
num_smallblocks
= 100,
grain
= 16. The default for
num_smallblocks
is unchanged from PA
systems and the SVID 3 default. The default for
grain
is the default
alignment for Itanium-based systems (16), which is the smallest
grain
allowable given that small blocks must have at least the default
alignment. This requirement in turn comes from the standards
requirement that malloc() must always return an address suitably
aligned for any basic data type, and Itanium-based systems support
16-byte basic data types.
The new default for
__maxfast
is 512, which is changed from 0 on PA
systems. This means that the SBA is now active by default, rather than
inactive by default, as was and remains the case for PA systems.
Three exported integer variables have been added for IPF:
int __hp_malloc_maxfast;
int __hp_malloc_grain;
int __hp_malloc_num_smallblocks;
These three variables may be set by applications to override the SBA
defaults; e.g. if an application links to a module that defines
int __hp_malloc_maxfast = -1;
then the value -1 will be seen for
__hp_malloc_maxfast
when the
function __get_sba_global() is called. The -1 value for
__hp_malloc_maxfast
means that the SBA should be turned off, i.e.
__maxfast
will be set to 0. A positive value for
__hp_malloc_maxfast
will replace the default value of
__maxfast
after rounding to a multiple
of the
grain
. Positive values for the variables
__hp_malloc_grain
and
__hp_malloc_num_smallblocks
will be used to replace the
grain
and
num_smallblocks
values if the resulting values would be legal.
These global variables override the environment variable _M_SBA_OPTS.
It is presumed that any ISV that builds an application so that these
variables are set wants that tuning and no other. However, subsequent
mallopt() calls will revise the values for SBA configuration if the SBA
has not yet been allocated. (In the same way that mallopt() calls will
revise the SBA configuration even when the environment variable
_M_SBA_OPTS has been set if the SBA has not yet been allocated at the