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.
Dependents: Utility_AvailableMemory_blinky
Fork of AvailableMemory by
Revision 11:0f5d5918761a, committed 2010-11-08
- Comitter:
- segundo
- Date:
- Mon Nov 08 12:42:34 2010 +0000
- Parent:
- 10:7474d5df69c2
- Child:
- 12:3004855925ff
- Commit message:
Changed in this revision
| AvailableMemory.cpp | Show annotated file Show diff for this revision Revisions of this file |
| AvailableMemory.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/AvailableMemory.cpp Sun Nov 07 21:52:34 2010 +0000
+++ b/AvailableMemory.cpp Mon Nov 08 12:42:34 2010 +0000
@@ -4,11 +4,6 @@
namespace segundo {
namespace Utilities {
-int AvailableMemory() {
-
- return AvailableMemory(256, 0x8000, true);
-}
-
int AvailableMemory(int resolution, int maximum, bool disableInterrupts) {
if (resolution < 1) resolution = 1;
--- a/AvailableMemory.h Sun Nov 07 21:52:34 2010 +0000
+++ b/AvailableMemory.h Mon Nov 08 12:42:34 2010 +0000
@@ -1,5 +1,5 @@
/** @file
- * Return the memory available for a malloc call
+ * @brief Return the memory available for a malloc call
* This is done by a binary search approach
* calling malloc/free starting with a maximum
*/
@@ -16,19 +16,14 @@
namespace Utilities {
/** Return the memory available for a malloc call
- * @return AvailableMemory(256, 0x8000, true)
+ * @param resolution Resolution in number of bytes,
+ * 1 will return the exact value,
+ * default is 256 which will return the available memory to the nearest 256 bytes
+ * @param maximum Maximum amount of memory to check, default is 32K
+ * @param disableInterrupts Disable interrupts whilst checking, default is true
+ * @return Available memory in bytes accurate to within resolution
*/
-int AvailableMemory();
-
-/** Return the memory available for a malloc call
- * @param resolution Resolution in number of bytes
- * 1 will return the exact value
- * 256 will return the available memory to the nearest 256 bytes
- * @param maximum Maximum amount of memory to check
- * @param disableInterrupts Disable interrupts whilst checking
- * @return Available memory in bytes
- */
-int AvailableMemory(int resolution, int maximum, bool disableInterrupts);
+int AvailableMemory(int resolution = 256, int maximum = 0x8000, bool disableInterrupts = true);
} // namespace Utilities
} // namespace segundo
