User manual

mikroBasic PRO for PIC32
MikroElektronika
335
FreeMem
Prototype
sub procedure FreeMem(dim byref P as ^longword, dim ActualSize as 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 sub 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.
MM_LargestFreeMemBlock
Prototype
sub function MM_LargestFreeMemBlock() as word
Description This sub 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
dim block as word
...
block = MM_LargestFreeMemBlock()
Notes None.
MM_TotalFreeMemSize
Prototype
sub function MM_TotalFreeMemSize() as word
Description This sub 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
dim total as word
...
total = MM_TotalFreeMemSize()
Notes None.