#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... | |
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.
NDEBUG If defined, assertions are disabled. You should normally leave this undefined even in production code. DEBUG If defined, extra checking code is enabled. This should be defined for the debug build of this library. MeMemoryTRACE Usually you want to set this to 1 for the debug build of this library. MeMemorySTATS Usually you want to set this to 1 for the debug build of this library.
|
Initializer:
{
&ArraysSetOptions,
&ArraysGetOptions,
&ArraysInit,
&ArraysCreate,
&ArraysResize,
&ArraysIncRef,
&ArraysDecRef,
&ArraysDestroy,
&ArraysGetStats,
&ArraysTerm
}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.
Copyright MathEngine PLC 2000, all rights reserved.