Commit Graph

1 Commits (12336f017573512107a592f7b51b4ed485ce42c5)

Author SHA1 Message Date
Bogdan Marinescu 40438227ee Runtime dynamic memory tracing
This commit adds a dynamic memory tracer that calls a callback whenever
one of the basic memory allocation functions (malloc, realloc, calloc,
free) is called. The operation of the tracer is guarded by the
'MBED_MEM_TRACING_ENABLED` macro.

Infinite recursion during tracing is guarded by using atomic
increment/decrement primitives on the `trace_level` variable.

Thanks to @c1728p9 and @heky for their help and  suggestions.
2016-09-15 17:56:11 +01:00