Debug macros and functions for tracing memory usage for the malloc() and free() functions.
Can also be used to get information about both size and placement of the heap memory.
#define Insert_label |
( |
|
name | ) |
__asm__ __volatile__ (STRINGZ(name)":"); |
This macro is used to insert labels into assembly output.
#define Uc3_trace |
( |
|
debug_addr, |
|
|
|
x |
|
) |
| |
Value:
*(
U32*)(*(
U32*)(debug_addr)+4) = 0xdeadbeef ;\
*(
U32*)(debug_addr ) = *(
U32*)(debug_addr)+4
uint32_t U32
32-bit unsigned integer.
Definition: compiler.h:218
#define Uc3_trace_init |
( |
|
debug_addr | ) |
*(U32*)(debug_addr)=debug_addr+4 |
These macros are used to add traces memory.
First, initialize the trace with Uc3_trace_init(pointer), giving the start address of the memory location where will be stored the trace. Use Uc3_trace(something) to store "something" into the memory. The end of the trace is signalled by the "0xdeadbeef" pattern.
U32 get_heap_curr_used_size |
( |
void |
| ) |
|
Returns the number of bytes currently used from the HEAP.
- Return values
-
total | number of used bytes. |
U32 get_heap_free_size |
( |
void |
| ) |
|
Returns the number of free bytes in the HEAP.
This function tries to allocate the maximum number of bytes by dichotomical method.
- Return values
-
U32 get_heap_total_used_size |
( |
void |
| ) |
|
Returns the number of total of used bytes allocated from the HEAP.
- Return values
-
total | number of used bytes. |
void uc3_round_trace |
( |
U32 |
val | ) |
|
Trace a data in the round buffer.
The end of the trace is signalled by the "0xdeadbeef" pattern.
- Parameters
-
References round_trace_pbuf.
void uc3_round_trace_init |
( |
void * |
buf, |
|
|
U32 |
size |
|
) |
| |
Initialize the trace using a round buffer.
- Parameters
-
buf | Base address of the buffer used for the trace. |
size | Size of the round buffer. Must be a power of 2. |