Bionic Buffalo Tech Note #102: Using the Ivory Coast Memory Management Routines
Bionic Buffalo Tech Note #102
Using the Ivory Coast Memory Management Routines
last revised Friday 2003.05.23
©2003 Bionic Buffalo Corporation. All Rights Reserved.
Tatanka and TOAD are trademarks of Bionic Buffalo Corporation
Introduction
The Ivory Coast library is a collection of C language routines to make it easier to write portable code,
and to provide some useful, general purpose functions and definitions for application development.
Among other things, the library includes various memory management routines which are wrappers for
malloc()
,
free()
, and related other standard memory management functions. This Tech Note
describes the ivory coast memory management routines, their design rationale, and explains how they
are used.
The Ivory Coast library is available at http://www.tatanka.com/prod/info/ivoire.html.
Background and Design Rationale
The C language has long relied on
malloc()
,
free()
and related other routines for memory
allocation, release, and ancillary functions. Some routines in the standard libraries, such as
strdup()
, return memory allocated using
malloc()
.
Although
malloc()
and
free()
are almost universally available, there are occasional
environments (especially some embedded operating systems) which do not offer them. When they do
exist, the behaviour isn't always the same from one platform to the next. (For example, calling
free(NULL)
sometimes works, and sometimes doesn't.) Some environments which do have
malloc()
,
free()
, and the other procedures defined in the standard, also offer other procedures
which are not in the standard and are not always available on other platforms. Some of these are
wrappers around standard routines, offering additional functionality (such as tracing or process failure
in case sufficient memory isn't available).
Bionic Buffalo wanted memory allocation functions that offered some of these extended functions,
plus others, in a portable way, and could not find an existing API that met its requirements. It
developed an API, which evolved into the current Ivory Coast memory management API. Older forms
of the API were found in the Morocco and Mongolia libraries, but with the A-series revisions the API
is now found in the Ivory Coast library.
Page 1 of 6