10-58
BajaPPC-750: Monitor
10.15.14 Memory Management
SYNOPSIS
char *Malloc(unsigned long NumBytes)
char *Calloc(unsigned long NumElements,
unsigned long Size)
void Free(unsigned long *MemLoc)
void CFree(unsigned long *Block)
char *ReAlloc(char *Block,
unsigned long NumBytes)
void MemReset(void)
void MemAdd(unsigned long MemAddr,
unsigned long MemSize)
void MemStats(void)
DESCRIPTION
The memory management functions allocate and free memory from a mem-
ory pool. The monitor initializes the memory pool to use all on-card memory
after the monitor’s
bss
section. If any of the autoboot features are used, the
memory pool is not initialized and the application program is required to set
up the memory pool for these functions.
The functions
Malloc
,
Calloc
and
ReAlloc
allocate memory from the mem-
ory pool. Each of these functions returns a pointer to the memory requested
if the request can be satisfied and NULL if there is not enough memory to sat-
isfy the request. The function
Malloc
accepts one argument
NumBytes
indi-
cating the number of bytes requested. The function
Calloc
accepts two
arguments
NumElements
and
Size
indicating a request for a specified number
of elements of the specified size. The function
ReAlloc
reallocates a memory
block by either 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
,
Calloc
, 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.
Содержание BajaPPC-750
Страница 2: ...BajaPPC 750 PowerPC Based Single Board Computer User s Manual May 2002...
Страница 4: ...BajaPPC 750 PowerPC Based Single Board Computer User s Manual May 2002...
Страница 7: ......
Страница 16: ...0002M621 15 ix Register Map 9 1 Counter Timer Status CTSR 9 2 Register Map 9 2 Counter Timer Mode CTMR 9 4...
Страница 19: ...xii BajaPPC 750 Contents...
Страница 57: ...3 12 BajaPPC 750 Central Processing Unit May 2002...
Страница 77: ...5 12 BajaPPC 750 PMC PCI Interface May 2002...
Страница 111: ...6 34 BajaPPC 750 VMEbus Interface May 2002...
Страница 135: ...8 18 BajaPPC 750 Serial and Parallel I O May 2002...
Страница 207: ...10 68 BajaPPC 750 Monitor May 2002...