MemLib 1.00  -  Memory allocation system

by Thomas Down


MemLib accompanies the Compiler Corner article in the magazine. It provides a simple memory allocation system based on a public domain implementation of the malloc system. When running under RISC OS 3.5 or later, MemLib will allocate memory from a dynamic area. On earlier machines, it will default to allocating from application space.

The MemLib calls are documented in the commented header file, MemLib:mem.h. To use MemLib in your own applications, link them with MemLib:o.MemLib.

Full source code can be found in the C directory. Note that the file MemLib:c.alloc is based on a public domain malloc implementation for UNIX systems, written by Doug Lea.

 Copyright RISC User Magazine 1997
