Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AvailableMemory FatFileSystem mbed myUSBHost
segundo::Utilities Namespace Reference
A collection of utilities. More...
| Functions | |
| int | AvailableMemory (int resolution=256, int maximum=0x8000, bool disableInterrupts=true) | 
| Return the memory available for a malloc call. | |
Detailed Description
A collection of utilities.
Function Documentation
| int AvailableMemory | ( | int | resolution = 256, | 
| int | maximum = 0x8000, | ||
| bool | disableInterrupts = true | ||
| ) | 
Return the memory available for a malloc call.
This is done by a binary search approach calling malloc/free starting with a maximum.
Example:
#include <stdio.h> #include "AvailableMemory.h" int main() { printf("Available memory (bytes to nearest 256) : %d\n", AvailableMemory()); printf("Available memory (exact bytes) : %d\n", AvailableMemory(1)); }
- Parameters:
- 
  resolution Resolution in number of bytes, 1 will return the exact value, default will return the available memory to the nearest 256 bytes maximum Maximum amount of memory to check, default is 32K (0x8000) disableInterrupts Disable interrupts whilst checking, default is true 
- Returns:
- Available memory in bytes accurate to within resolution
Definition at line 7 of file AvailableMemory.cpp.
Generated on Tue Jul 12 2022 18:48:53 by
 1.7.2
 1.7.2