background image
Bionic Buffalo Tech Note #102: Using the Ivory Coast Memory Management Routines
In the current version of the library, the use of 
 is not thread safe.
Using the Memory Routines in Applications
The Ivory Coast library, and other libraries, use the memory allocation routines internally. Often, there
is no explicit way to set the memory allocation flags for calls such as 
However, the memory allocation routines refer to the global variable 
    civ_flags_T    civ_memory_flags_default ;
during their operation. If any of the five library flags or eight user flags are set in this variable, then
they are applied to the calls made by the library or the application. For example, an application which
executes the statement
    civ_memory_flags_default |= CIV_MEMORY_FLAG_CLEAR_ALLOCATED ;
will cause all subsequent memory allocations to zero the user blocks before returning to the caller.
Remember that the pointers returned or used by the 
 routines are incompatible
with the pointers returned or used by 
, and other standard library routines. This
includes standard routines such as 
, which allocates a buffer using 
. An
application using the Ivory Coast memory procedures should avoid such libary routines; instead, it
should use compatible procedures such as 
. , which allocate their
buffers using the 
This Tech Note may be reproduced and distributed (including by means of the Internet) without
payment of fees or without notification to Bionic Buffalo, as long as it is not changed, altered, or
edited in any way. Any distribution or copy must include the entire Tech Note, with the original title,
copyright notice, and this paragraph. For available Tech Notes, please see the Bionic Buffalo web site
at, or e-mail PGP/GnuPG key
a836 e7b0 24ad 3259 7c38 b384 8804 5520 2c74 1e5a
Page 6 of 6