Skip to content

Commit

Permalink
Fixed compile error with SHM_EXTRA_STATS.
Browse files Browse the repository at this point in the history
Variable mismatch introduced with commit 24b0735076c20464f22047201674f78d184d72ee0

(cherry picked from commit 04be335)
  • Loading branch information
bogdan-iancu committed May 28, 2019
1 parent f125a64 commit 18ecc3a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mem/shm_mem.h
Expand Up @@ -435,13 +435,13 @@ inline static void _shm_free(void *ptr,
shm_lock();

#ifdef SHM_EXTRA_STATS
if (shm_stats_get_index(_p) != VAR_STAT(MOD_NAME)) {
update_module_stats(-shm_frag_size(_p), -(shm_frag_size(_p) + shm_frag_overhead), -1, shm_stats_get_index(_p));
if (shm_stats_get_index(ptr) != VAR_STAT(MOD_NAME)) {
update_module_stats(-shm_frag_size(ptr), -(shm_frag_size(ptr) + shm_frag_overhead), -1, shm_stats_get_index(ptr));
LM_GEN1(memlog, "memory freed from different module than it was allocated, allocated in"
"module with index %ld, freed in module index %ld, at %s: %s %d \n", shm_stats_get_index(_p), VAR_STAT(MOD_NAME),
"module with index %ld, freed in module index %ld, at %s: %s %d \n", shm_stats_get_index(ptr), VAR_STAT(MOD_NAME),
__FILE__, __FUNCTION__, __LINE__);
} else {
update_module_stats(-shm_frag_size(_p), -(shm_frag_size(_p) + shm_frag_overhead), -1, VAR_STAT(MOD_NAME));
update_module_stats(-shm_frag_size(ptr), -(shm_frag_size(ptr) + shm_frag_overhead), -1, VAR_STAT(MOD_NAME));
}
#endif

Expand Down Expand Up @@ -474,13 +474,13 @@ inline static void _shm_free_bulk(void *ptr,
const char* file, const char* function, unsigned int line)
{
#ifdef SHM_EXTRA_STATS
if (shm_stats_get_index(_p) != VAR_STAT(MOD_NAME)) {
update_module_stats(-shm_frag_size(_p), -(shm_frag_size(_p) + shm_frag_overhead), -1, shm_stats_get_index(_p));
if (shm_stats_get_index(ptr) != VAR_STAT(MOD_NAME)) {
update_module_stats(-shm_frag_size(ptr), -(shm_frag_size(ptr) + shm_frag_overhead), -1, shm_stats_get_index(ptr));
LM_GEN1(memlog, "memory freed from different module than it was allocated, allocated in"
"module with index %ld, freed in module index %ld, at %s: %s %d \n", shm_stats_get_index(_p), VAR_STAT(MOD_NAME),
"module with index %ld, freed in module index %ld, at %s: %s %d \n", shm_stats_get_index(ptr), VAR_STAT(MOD_NAME),
__FILE__, __FUNCTION__, __LINE__);
} else {
update_module_stats(-shm_frag_size(_p), -(shm_frag_size(_p) + shm_frag_overhead), -1, VAR_STAT(MOD_NAME));
update_module_stats(-shm_frag_size(ptr), -(shm_frag_size(ptr) + shm_frag_overhead), -1, VAR_STAT(MOD_NAME));
}
#endif

Expand Down

0 comments on commit 18ecc3a

Please sign in to comment.