MEM Module
Application Program Interface
2-201
2.15
MEM Module
The MEM module is the memory segment manager.
Functions
❏
MEM_alloc. Allocate from a memory segment.
❏
MEM_calloc. Allocate and initialize to 0.
❏
MEM_define. Define a new memory segment.
❏
MEM_free. Free a block of memory.
❏
MEM_getBaseAddress. Get base address of memory heap.
❏
MEM_increaseTableSize. Increase the internal MEM table size.
❏
MEM_redefine. Redefine an existing memory segment.
❏
MEM_stat. Return the status of a memory segment.
❏
MEM_undefine. Undefine an existing memory segment.
❏
MEM_valloc. Allocate and initialize to a value.
Constants, Types,
and Structures
MEM->MALLOCSEG = 0; /* segid for malloc, free */
#define MEM_HEADERSIZE /* free block header size */
#define MEM_HEADERMASK /* mask to align on
MEM_HEADERSIZE */
#define MEM_ILLEGAL /* illegal memory address */
MEM_Attrs MEM_ATTRS ={ /* default attribute values */
0
};
typedef struct MEM_Segment {
Ptr base; /* base of the segment */
MEM_sizep length; /* size of the segment */
Uns space; /* memory space */
} MEM_Segment;
typedef struct MEM_Stat {
MEM_sizep size; /* original size of segment */
MEM_sizep used; /* MADUs used in segment */
size_t length; /* largest contiguous
block */
} MEM_Stat;
typedef unsigned long MEM_sizep;
Configuration
Properties
The following list shows the properties that can be configured in a Tconf
script, along with their types and default values. For details, see the MEM
Manager Properties and MEM Object Properties headings. For
descriptions of data types, see Section 1.4,