aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-06-30 17:29:36 +0200
committerSverker Eriksson <[email protected]>2017-06-30 17:29:36 +0200
commit28b43fc941659a8283693b0f5de107610ad0dc1b (patch)
tree8b1b095792477eb218dee59eb123d882ea10ec5b /erts/emulator/beam/erl_alloc.h
parentdbbf643c632a175a28ea39ba780947ff13eca039 (diff)
downloadotp-28b43fc941659a8283693b0f5de107610ad0dc1b.tar.gz
otp-28b43fc941659a8283693b0f5de107610ad0dc1b.tar.bz2
otp-28b43fc941659a8283693b0f5de107610ad0dc1b.zip
erts: Increase pre-allocated blocks #ifdef DEBUG
Choose a "lagom" low value to provoke both fallback on erts_alloc AND thread racing in lockless deallocation queue.
Diffstat (limited to 'erts/emulator/beam/erl_alloc.h')
-rw-r--r--erts/emulator/beam/erl_alloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h
index f540bae20d..89a7052894 100644
--- a/erts/emulator/beam/erl_alloc.h
+++ b/erts/emulator/beam/erl_alloc.h
@@ -407,7 +407,7 @@ NAME##_free(TYPE *p) \
}
#ifdef DEBUG
-#define ERTS_PRE_ALLOC_SIZE(SZ) 2
+#define ERTS_PRE_ALLOC_SIZE(SZ) ((SZ) < 1000 ? (SZ)/10 + 10 : 100)
#define ERTS_PRE_ALLOC_CLOBBER(P, T) memset((void *) (P), 0xfd, sizeof(T))
#else
#define ERTS_PRE_ALLOC_SIZE(SZ) ((SZ) > 1 ? (SZ) : 1)