aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-30 15:55:39 +0100
committerBjörn Gustavsson <[email protected]>2012-01-31 08:57:33 +0100
commitdacc3570332103d1f37e72463e88a2550010df77 (patch)
tree3d516db5493f5019ed2d6979123830155e9022c8 /erts/emulator
parent1408c848ef81651df1a8304d81948f6bb3b88eac (diff)
downloadotp-dacc3570332103d1f37e72463e88a2550010df77.tar.gz
otp-dacc3570332103d1f37e72463e88a2550010df77.tar.bz2
otp-dacc3570332103d1f37e72463e88a2550010df77.zip
erts: Correct incorrect assertion in erl_alloc_util.c
The incorrect assertion would fire when '+Muramv true' has been given, i.e. when a reallocation always forces a move. Change the assertion to not call the lock checker if the mutex is not used (because the allocator will only be accessed from a specific scheduler and thus no lock is needed).
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index c32938bdff..2e1a92f61d 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -3956,7 +3956,8 @@ realloc_thr_pref(ErtsAlcType_t type, void *extra, void *p, Uint size,
if (used_allctr->thread_safe && (!force_move
|| used_allctr != pref_allctr))
erts_mtx_lock(&used_allctr->mutex);
- ERTS_SMP_LC_ASSERT(erts_lc_mtx_is_locked(&used_allctr->mutex));
+ ERTS_SMP_LC_ASSERT(!used_allctr->thread_safe ||
+ erts_lc_mtx_is_locked(&used_allctr->mutex));
cpy_size = BLK_SZ(blk);
if (used_allctr->thread_safe && (!force_move
|| used_allctr != pref_allctr))