User manual
324
mikoPascal PRO for PIC32
MikroElektronika
Heap_Init
GetMem
Prototype
procedure Heap_Init();
Description Sets Heap size.
Parameters None.
Returns Nothing.
Requires Nothing.
Example
const HEAP_SIZE = 3000; // declare Heap size
Heap_Init(); // set Heap size
Notes None.
Prototype
procedure GetMem(var P: ^dword; WantedSize: word);
Description Fetches memory from the memory heap.
Parameters - WantedSize: pointer to the fetched memory
- WantedSize: size in bytes of the dynamic variable to allocate
Returns Returns a pointer to the fetched memory (of “WantedSize” bytes) in P if success; Otherwise 0 (no free
blocks of memory are large enough).
Requires Nothing.
Example
GetMem(ptr,20*sizeof(PBuffer)); // ptr will point to a memory block where
PBuffer is allocated
Notes None.
Memory Manager Library
This library provides routines for accessing microcontroller’s (internal) Flash memory.
Library Routines
- Heap_Init
- malloc
- free
- LargestFreeMemBlock
- TotalFreeMemSize