initial test app that shows potential memory usage by mbed-rtos
Dependencies: mbed-rtosMemoryTest mbed
Diff: heapsize.hpp
- Revision:
- 0:9a0840718117
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/heapsize.hpp Tue Dec 09 18:42:05 2014 +0000 @@ -0,0 +1,15 @@ +#ifndef __HEAPSIZE_HPP__ +#define __HEAPSIZE_HPP__ + +unsigned long heapSize() +{ + char stackVariable; + void *heap; + unsigned long result; + heap = malloc(4); + result = (uint8_t*)&stackVariable - (uint8_t*)heap; + free(heap); + return result; +} + +#endif \ No newline at end of file