Emerson PMT1 Manuel D’Utilisation

Page de 128
Monitor:
 Standard Monitor Functions
PmT1 and PmE1 User’s Manual
10002367-02
8-40
returning the block specified by Block to the free pool and allocating a new block of size 
NumBytes, or by determining that the memory block specified by Block is big enough and 
returning the same block to be reused. 
The functions Free and CFree return blocks of memory that were requested by Malloc, Cal-
loc, or ReAlloc to the free memory pool. The address of the block to be returned is specified 
by the argument MemLoc, which must be the same value returned by one of the allocation 
functions. An attempt to return memory that was not acquired by the allocation functions 
is a fairly reliable way of blowing up a program and should be avoided. 
The function MemReset sets the free memory pool to the empty state. This function must 
be called once for every reset operation and before the memory management facilities can 
be used. It is also necessary to call this function before every call to MemAdd. 
The function MemAdd initializes the free memory pool to use the memory starting at 
MemAddr of size specified by MemSize. This function currently allows for only one contigu-
ous memory pool and must be preceded by a function call to MemReset. 
The function MemStats monitors memory usage. This function outputs a table showing 
how much memory is available and how much is used and lost as a result of overhead.
See also:
MemTop, MemBase.
NVSupport
SetNvDefaults(Groups, NumGroups)
NVGroupPtr Groups;
int NumGroups;
DispGroup(Group, EditFlag)
NVGroupPtr Group;
unsigned long EditFlag;
NVOp(NVOpCmd, Base, Size, Offset)
unsigned long NVOpCmd, Size, Offset;
unsigned char *Base;
Description:
The support functions used for displaying, initializing, and modifying the nonvolatile mem-
ory data structures can also be used to manage other data structures that may or may not 
be stored in nonvolatile memory. 
The method used to create a display of a data structure is to create a second structure that 
contains a description of every field of the first structure. This description is done using the 
NVGroup structure. Each entry in the NVGroup structure describes a field name, pointer to 
the field, size of the field, indication of how the field is to be displayed, and the initial value 
of the field. 
An example data structure is shown below, as well as the NVGroup data structure necessary 
to describe the data structure. This example might describe the coordinates and depth of a 
window structure.