background image
Bionic Buffalo Tech Note #102: Using the Ivory Coast Memory Management Routines
An application can determine the values of the user flags associated with a specific block by calling the
    civ_status_T    civ_memory_flags_get
                            ( void            * pointer,
                            civ_flags_T       * flags ) ;
The flags value returned will contain the user flags as the least significant eight bits. The values of
other bits are not defined. The returned value can be masked by ANDing it with
. If desired, the user flags can be modified and rewritten
to the block by calling
    civ_status_T    civ_memory_flags_set
                            ( void            * pointer,
                            civ_flags_T         flags ) ;
 is called, none of the 
 bits above the least significant
eight should be set. Otherwise, the consequences are unpredictable.
Checking Memory
An application can check a single block of memory for integrity using
    civ_status_T    civ_memory_validate_user_block
                            ( void            * pointer,
                            civ_flags_T         flags ) ;
This will verify the correct value of the canary (if any), and do some consistency checking on the
By default, there is no way to check all of the blocks together, because the library doesn't keep a
master list of allocated blocks. However, if the library is built with the 
flag set, then the library adds extra fields to the prefix to keep a linked list of all allocated blocks. In
that case,
    civ_status_T    civ_memory_validate_all
                            ( civ_flags_T       flags ) ;
can be called to check every allocated block. (The value of 
 is defined
in the ivory coast header files.)
There is an additional routine defined by the library,
, which is used internally and should not be called
by applications.
Page 5 of 6