Return region tag in mem_debug_malloc_dump()
Also in mem_init_dog() avoid making a byte access to the task name in the debug block because that fails for the IRAM heap region.
This commit is contained in:
parent
241ecad44e
commit
88ab5d4830
2 changed files with 7 additions and 3 deletions
|
@ -86,6 +86,7 @@ size_t mem_debug_malloc_dump(int task, mem_dump_block_t* buffer, size_t size)
|
||||||
*(int*)buffer->task = btask;
|
*(int*)buffer->task = btask;
|
||||||
buffer->address = (void*)b;
|
buffer->address = (void*)b;
|
||||||
buffer->size = b->size;
|
buffer->size = b->size;
|
||||||
|
buffer->xtag = b->xtag;
|
||||||
++buffer;
|
++buffer;
|
||||||
--remaining;
|
--remaining;
|
||||||
b = b->next;
|
b = b->next;
|
||||||
|
@ -132,8 +133,9 @@ void mem_init_dog(void *data)
|
||||||
#if (INCLUDE_pcTaskGetTaskName == 1)
|
#if (INCLUDE_pcTaskGetTaskName == 1)
|
||||||
task = xTaskGetCurrentTaskHandle();
|
task = xTaskGetCurrentTaskHandle();
|
||||||
if (task){
|
if (task){
|
||||||
strncpy(b->head.task, pcTaskGetTaskName(task), 3);
|
int name = 0;
|
||||||
b->head.task[3] = '\0';
|
strncpy((char*)&name, pcTaskGetTaskName(task), 3);
|
||||||
|
*(int*)b->head.task = name;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*(int*)b->head.task = 0;
|
*(int*)b->head.task = 0;
|
||||||
|
|
|
@ -78,7 +78,9 @@ extern void mem_malloc_set_abort(int task, int size, int count);
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char task[4];
|
char task[4];
|
||||||
void* address;
|
void* address;
|
||||||
int size;
|
int size: 24; /*<< The size of the free block. */
|
||||||
|
int xtag: 7; /*<< Tag of this region */
|
||||||
|
int xAllocated: 1; /*<< 1 if allocated */
|
||||||
} mem_dump_block_t;
|
} mem_dump_block_t;
|
||||||
|
|
||||||
extern size_t mem_debug_malloc_dump(int task, mem_dump_block_t* buffer, size_t size);
|
extern size_t mem_debug_malloc_dump(int task, mem_dump_block_t* buffer, size_t size);
|
||||||
|
|
Loading…
Reference in a new issue