Commit Graph

5 Commits (20133688f064a84604ee72f6afacc9726e084ce6)

Author SHA1 Message Date
Sam Grove b2ce50a8d3 Merge pull request #2596 from neilt6/neilt6-memory-tracer-patch
[HAL] Improve memory tracer
2016-09-10 11:42:04 -05:00
Martin Kojtal 2df22277a5 alloc wrappers - fix calloc wrapping for uvisor
Done already in 7c0cc50, same applied to alloc wrappers that was moved
from retarget.
2016-09-02 11:07:19 +01:00
Neil Thiessen 6aab0606a1 [HAL] Improve memory tracer
Fixed a bug and compiler warning in the memory tracer implementation.
2016-08-31 11:46:42 -06:00
Bogdan Marinescu 8b908abcc5 Added thread safety to the tracing mechanism
Without this in place, traces might be lost if a another thread
interrupts a memory function at the right time.
2016-08-26 09:42:41 -05:00
Bogdan Marinescu 7d09bb7d3b 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-08-26 09:42:39 -05:00