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

(cherry picked from commit fcdd224)
  • Loading branch information
liviuchircu committed Jul 17, 2020
1 parent e6a86b6 commit bd2b151
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mem/hp_malloc.c
Expand Up @@ -1487,7 +1487,9 @@ 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 bd2b151

Please sign in to comment.