Example to demonstrate memory trace functionality in Mbed OS
Fork of memory_tracing_example by
main.cpp@1:168ab14e6694, 2018-05-25 (annotated)
- Committer:
- deepikabhavnani
- Date:
- Fri May 25 19:55:07 2018 +0000
- Revision:
- 1:168ab14e6694
- Parent:
- 0:a5479359bf28
Readme removed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
deepikabhavnani | 0:a5479359bf28 | 1 | #include <stdlib.h> |
deepikabhavnani | 0:a5479359bf28 | 2 | #include "mbed.h" |
deepikabhavnani | 0:a5479359bf28 | 3 | #include "mbed_mem_trace.h" |
deepikabhavnani | 0:a5479359bf28 | 4 | |
deepikabhavnani | 0:a5479359bf28 | 5 | |
deepikabhavnani | 0:a5479359bf28 | 6 | int main() { |
deepikabhavnani | 0:a5479359bf28 | 7 | mbed_mem_trace_set_callback(mbed_mem_trace_default_callback); |
deepikabhavnani | 0:a5479359bf28 | 8 | while (true) { |
deepikabhavnani | 0:a5479359bf28 | 9 | void *p = malloc(50); |
deepikabhavnani | 0:a5479359bf28 | 10 | wait(0.5); |
deepikabhavnani | 0:a5479359bf28 | 11 | free(p); |
deepikabhavnani | 0:a5479359bf28 | 12 | } |
deepikabhavnani | 0:a5479359bf28 | 13 | } |