Skip to content

Commit

Permalink
hp_malloc: populate DBG info for hp_free*
Browse files Browse the repository at this point in the history
(cherry picked from commit 410c664)
  • Loading branch information
razvancrainea committed Feb 4, 2020
1 parent ce3c4c5 commit 971a734
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mem/hp_malloc.c
Expand Up @@ -1122,6 +1122,11 @@ void hp_pkg_free(struct hp_block *hpb, void *p)

hp_frag_attach(hpb, f);
update_stats_pkg_frag_attach(hpb, f);
#ifdef DBG_MALLOC
f->file=file;
f->func=func;
f->line=line;
#endif

#if defined(DBG_MALLOC) && !defined(STATISTICS)
hpb->used -= f->size;
Expand All @@ -1148,6 +1153,11 @@ void hp_shm_free_unsafe(struct hp_block *hpb, void *p)

hp_frag_attach(hpb, f);
update_stats_shm_frag_attach(f);
#ifdef DBG_MALLOC
f->file=file;
f->func=func;
f->line=line;
#endif

#if defined(DBG_MALLOC) || defined(STATISTICS)
hpb->used -= f->size;
Expand Down Expand Up @@ -1177,6 +1187,11 @@ void hp_shm_free(struct hp_block *hpb, void *p)

SHM_LOCK(hash);
hp_frag_attach(hpb, f);
#ifdef DBG_MALLOC
f->file=file;
f->func=func;
f->line=line;
#endif
SHM_UNLOCK(hash);

update_stats_shm_frag_attach(f);
Expand Down

0 comments on commit 971a734

Please sign in to comment.