aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-11-16 18:52:55 +0100
committerBjörn-Egil Dahlberg <[email protected]>2012-12-14 15:12:50 +0100
commitf5bf29d4db2a257879641ae4fea7d6937027295c (patch)
tree5a2dbbf3c9e054dee75874b9001ae22c6e60e213 /erts/emulator/sys
parent38930473052af252b8f527200f4db9ba29f435ee (diff)
downloadotp-f5bf29d4db2a257879641ae4fea7d6937027295c.tar.gz
otp-f5bf29d4db2a257879641ae4fea7d6937027295c.tar.bz2
otp-f5bf29d4db2a257879641ae4fea7d6937027295c.zip
erts: Fix mseg cache. Malplaced NULL pointer
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/common/erl_mseg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c
index 2ff88ee435..7d03116daa 100644
--- a/erts/emulator/sys/common/erl_mseg.c
+++ b/erts/emulator/sys/common/erl_mseg.c
@@ -572,8 +572,8 @@ static ERTS_INLINE void *cache_get_segment(MemKind *mk, Uint size) {
/* unlink from cache area */
csize = c->size;
seg = c->seg;
- c->next = NULL;
mk->cache_area[i] = c->next;
+ c->next = NULL;
mk->cache_size--;
mk->cache_hits++;
@@ -592,11 +592,11 @@ static ERTS_INLINE void *cache_get_segment(MemKind *mk, Uint size) {
}
i--;
}
-
ASSERT(csize == size);
return seg;
}
}
+
return NULL;
}
@@ -707,6 +707,8 @@ static void mseg_clear_memkind_cache(MemKind *mk) {
mseg_drop_memkind_cache_size(mk, i);
}
+
+ ASSERT(mk->cache_size == 0);
}
static void mseg_clear_cache(ErtsMsegAllctr_t *ma) {