Skip to content

Commit

Permalink
memory manager: Improve hash debugging output
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Apr 17, 2018
1 parent f2a682a commit f357c85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mem/f_malloc.c
Expand Up @@ -721,6 +721,9 @@ void fm_status(struct fm_block* qm)
}

LM_GEN1(memdump, " dumping summary of all alloc'ed. fragments:\n");
LM_GEN1(memdump, "------------+---------------------------------------\n");
LM_GEN1(memdump, "total_bytes | num_allocations x [file: func, line]\n");
LM_GEN1(memdump, "------------+---------------------------------------\n");
for(i=0; i < DBG_HASH_SIZE; i++) {
it = allocd[i];
while (it) {
Expand All @@ -729,6 +732,7 @@ void fm_status(struct fm_block* qm)
it = it->next;
}
}
LM_GEN1(memdump, "----------------------------------------------------\n");

dbg_ht_free(allocd);
#endif
Expand Down
4 changes: 4 additions & 0 deletions mem/hp_malloc.c
Expand Up @@ -1472,6 +1472,9 @@ void hp_status(struct hp_block *hpb)
}

LM_GEN1(memdump, "dumping summary of all alloc'ed. fragments:\n");
LM_GEN1(memdump, "------------+---------------------------------------\n");
LM_GEN1(memdump, "total_bytes | num_allocations x [file: func, line]\n");
LM_GEN1(memdump, "------------+---------------------------------------\n");
for(i=0; i < DBG_HASH_SIZE; i++) {
it = allocd[i];
while (it) {
Expand All @@ -1480,6 +1483,7 @@ void hp_status(struct hp_block *hpb)
it = it->next;
}
}
LM_GEN1(memdump, "----------------------------------------------------\n");

dbg_ht_free(allocd);
#endif
Expand Down
4 changes: 4 additions & 0 deletions mem/q_malloc.c
Expand Up @@ -718,6 +718,9 @@ void qm_status(struct qm_block* qm)
}

LM_GEN1(memdump, " dumping summary of all alloc'ed. fragments:\n");
LM_GEN1(memdump, "----------------------------------------------------\n");
LM_GEN1(memdump, "total_bytes : num_allocations x [file: func, line]\n");
LM_GEN1(memdump, "----------------------------------------------------\n");
for(i=0; i < DBG_HASH_SIZE; i++) {
it = allocd[i];
while (it) {
Expand All @@ -726,6 +729,7 @@ void qm_status(struct qm_block* qm)
it = it->next;
}
}
LM_GEN1(memdump, "----------------------------------------------------\n");

dbg_ht_free(allocd);
#endif
Expand Down

0 comments on commit f357c85

Please sign in to comment.