User manual
mikroPascal PRO for PIC32
MikroElektronika
325
FreeMem
MM_LargestFreeMemBlock
MM_TotalFreeMemSize
Prototype
procedure FreeMem(var P: ^dword; ActualSize: word);
Description FreeMem destroys the variable referenced by P and returns its memory to the heap.
Parameters - P: variable of any pointer type previously assigned by the Getmem procedure.
- ActualSize: species the size in bytes of the dynamic variable to dispose of and should be the
same as the one used to Getmem.
Returns Nothing.
Requires Nothing.
Example
FreeMem(ptr,20*sizeof(PBuffer)); // ptr will point to a memory block where
PBuffer is allocated
Notes None.
Prototype
function MM_LargestFreeMemBlock() : word;
Description This function is used to determine largest available free memory block for the Heap.
Parameters None.
Returns Returns, after defragmentation of the freelist the size (in bytes) of the largest free block of contiguous
memory on the heap.
Requires Nothing.
Example
var block : word;
begin
block := MM_LargestFreeMemBlock();
end;
Notes None.
Prototype
function MM_TotalFreeMemSize() : word;
Description This function is used to determine total free memory size on the heap.
Parameters None.
Returns Returns the size (in bytes) of the total free memory on the heap.
Requires Nothing.
Example
var total : word;
begin
total := MM_TotalFreeMemSize();
end;
Notes None.