Skip to content

Commit

Permalink
HP_MALLOC statistics: Fix an int vs. long casting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Jan 22, 2020
1 parent d680f15 commit ac7de67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mem/hp_malloc_stats.h
Expand Up @@ -92,8 +92,8 @@ unsigned long hp_rpm_get_frags(struct hp_block *hpb);
#else /* HP_MALLOC_FAST_STATS */
#define update_stats_shm_frag_attach(frag) \
do { \
update_stat(shm_used, -(int)(frag)->size); \
update_stat(shm_rused, -(int)((frag)->size + FRAG_OVERHEAD)); \
update_stat(shm_used, -(long)(frag)->size); \
update_stat(shm_rused, -(long)((frag)->size + FRAG_OVERHEAD)); \
} while (0)

#define update_stats_shm_frag_detach(frag) \
Expand All @@ -111,8 +111,8 @@ unsigned long hp_rpm_get_frags(struct hp_block *hpb);

#define update_stats_rpm_frag_attach(frag) \
do { \
update_stat(rpm_used, -(int)(frag)->size); \
update_stat(rpm_rused, -(int)((frag)->size + FRAG_OVERHEAD)); \
update_stat(rpm_used, -(long)(frag)->size); \
update_stat(rpm_rused, -(long)((frag)->size + FRAG_OVERHEAD)); \
} while (0)

#define update_stats_rpm_frag_detach(frag) \
Expand Down

0 comments on commit ac7de67

Please sign in to comment.