User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
363
free
Prototype
void free(char * P, unsigned ActualSize);
Description This function is used to free memory block allocated by malloc.
Parameters - P: pointer to the memory block
- ActualSize: actual size of the memory block.
Returns Nothing.
Requires Nothing.
Example
int *pi; // pointer to integer
int ai[100]; // array of integers
void main() {
pi = (int *)malloc(sizeof ai); // pi will point to a memory block in the
Heap where the array is allocated
free(pi, sizeof(pi)); // frees memory block from the Heap allocated by
malloc, pointed to by the pi pointer
}
Notes None.
LargestFreeMemBlock
Prototype
unsigned LargestFreeMemBlock();
Description This function is used to determine largest available free memory block for the Heap.
Parameters None.
Returns Largest free memory block for the Heap.
Requires Nothing.
Example
unsigned block;
void main() {
block = LargestFreeMemBlock();
}
Notes None.
TotalFreeMemSize
Prototype
unsigned TotalFreeMemSize();
Description This function is used to determine total free memory size.
Parameters None.
Returns Total free memory size.
Requires Nothing.
Example
unsigned total;
void main() {
block = TotalFreeMemSize();
}
Notes None.