Multi-dimensional array allocation - the *easy* way.
Peter Davidson
naga at wet.UUCP
Wed Mar 6 18:44:14 AEST 1991
A few folks here have been discussing the complexities involved
in dynamic allocation of multi-dimensional arrays. It is indeed
somewhat tricky to do - unless you do it the *easy* way: just use
the functions provided in the following library:
NEW PRODUCT ANNOUNCEMENT
Dolphin Software Ships Far Memory Management Library
Dolphin Software is now shipping a new C function library, the Far
Memory Manager & Diagnostic C Library, which runs on PCs. This is, in
part, a memory debugging package. It is a replacement for the far
memory functions in the Microsoft C and Turbo C libraries, and is an
extension to them, providing numerous additional far memory functions.
Two of the extensions are a memory allocation log and an automatic
termination on detection of a critical memory error.
The library provides a debugging tool in the form of a memory allocation
log, in which details of memory operations can be recorded as they
occur. This log can be played back at any time (with output to screen,
printer or disk file) in either of two forms. The items are output
either in chronological order or grouped into operations on the same
block (thus providing an individual block history).
Using the Dolphin library functions it is possible to set a flag that
will cause the program to terminate when any of the functions detects a
critical memory error (that is, damage to the control blocks). Any of
the available reports can be output automatically upon termination, thus
providing a history of far memory operations up to the point at which
the error was detected. A far heap dump function is provided for
capturing details of the far heap at any time.
A number of multi-dimensional array allocation functions are part of the
library, along with functions to free those arrays. This makes it easy
to allocate memory for arrays (of any type of object) in far memory,
which arrays may be as large as available memory permits. Array
operations can also be recorded in the log, together with the
constituent memory block allocations that make up a multi-dimensional
array allocation.
The library is supplied in two versions, one for Microsoft C (Versions
5.10 or 6.00) and one for Borland's Turbo C (Version 2.00), and in
small, medium and large models. In addition a special header file is
provided, together with the source code for a dozen demonstration
programs, illustrating the use of the functions. All demo programs can
be compiled and executed. There is a printed manual fully explaining the
demo programs as well as the functions themselves.
The library is priced at $99.00. There is a demo disk available.
For more information, contact Dolphin Software, 148 Shattuck Square
#147, Berkeley, CA 94704
A *special offer for readers of this posting*: If you order this
library now (well, within the next hour) and say "I saw it on
comp.lang.c" then a check for $49.00 (inclusive price) will suffice.
Really - wouldn't you prefer to be imbibing the wisdom of comp.lang.c's
experts discussing *new* and *fascinating* problems, rather than
spending unrewarding hours reinventing the wheel? As they say
(well, we say it here) - if the tools are there, use 'em.
More information about the Comp.lang.c
mailing list