Skip to content

Commit

Permalink
HP_MALLOC status logging: Fix incorrect bitwise shift
Browse files Browse the repository at this point in the history
CID #200101
  • Loading branch information
liviuchircu committed Jul 9, 2020
1 parent 3263b27 commit fcdd224
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mem/hp_malloc_dyn.h
Expand Up @@ -1567,7 +1567,8 @@ void hp_status(struct hp_block *hpb)

if (h > HP_LINEAR_HASH_SIZE) {
LM_GEN1(memdump, "[ %4d ][ %8d B -> %7d B ][ frags: %5d ]\n",
h, (int)UN_HASH(h), (int)UN_HASH(h+1) - (int)ROUNDTO, i);
h, (int)UN_HASH(h),
(int)UN_HASH(h == (HP_HASH_SIZE - 1) ? h : h+1) - (int)ROUNDTO, i);
} else
LM_GEN1(memdump, "[ %4d ][ %5d B ][ frags: %5d ]\n",
h, h * (int)ROUNDTO, i);
Expand Down

0 comments on commit fcdd224

Please sign in to comment.