MathEngine
Home Page       Structures       File List       Functions and Macros      

Arrays.c File Reference

Implementation of a memory manager that stores fixed-size pools of fixed-size blocks as arrays. More...

#include <stddef.h>
#include <string.h>
#include "Bits.h"
#include "MeMemory.h"
#include "Trace.h"
#include "Arrays.h"
#include "MeAssert.h"

Variables

unsigned MeMemoryDoTraceArrays = 1
 Set this to 0 to disable tracing of API calls in the Arrays memory manager, leaving it on globally with the MeMemoryDoTrace variable.

unsigned MeMemoryDoStatsArrays = 1
 Set this to 0 to disable tracing of API calls in the Arrays memory manager, leaving it on globally with the MeMemoryDoStats variable.

struct MeMemoryOptions MeMemoryOptionsArrays
 The options for the Arrays memory manager.

struct MeMemoryStats MeMemoryStatsArrays
 The statistics for the Arrays memory manager.

struct MeMemoryAPI MeMemoryAPIArrays
 Table of function pointers to entry points of the Arrays memory manager. More...


Detailed Description

Implementation of a memory manager that stores fixed-size pools of fixed-size blocks as arrays.

This file implements a full memory manager, rather than just a wrapper, for the MeMemoryAPI interface. This memory manager handles a fixed number of fixed size blocks; each set of blocks of the same size is stored contiguously as an array.

This memory manager must be passed a memory arena of sufficient size, which it then subdivides in overhead areas and fixed size block arrays.

This memory managed can be compiled in debug mode, in which case it will expend extra memory and time to check that the user program is well behaved; for example each block will be surrounded by a redzone, and it will be checked that the redzone is left intact.

Compilation flags

Variable Documentation

struct MeMemoryAPI MeMemoryAPIArrays

Initializer:

{
  &ArraysSetOptions,
  &ArraysGetOptions,
  &ArraysInit,

  &ArraysCreate,
  &ArraysResize,
  &ArraysIncRef,
  &ArraysDecRef,
  &ArraysDestroy,

  &ArraysGetStats,
  &ArraysTerm
}
Table of function pointers to entry points of the Arrays memory manager.

This (v)table provides the implementation of the MeMemoryAPI interface for the Arrays memory managed. You should typically assign it to the MeMemoryAPI global variable to select the Arrays memory manager.


MathEngine Utilities: Memory Manager API - Version 0.0.5 Alpha - Reference Manual generated using doxygen at Wed Oct 11 00:34:56 2000

Copyright MathEngine PLC 2000, all rights reserved.