aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-02-08 18:00:45 +0100
committerSverker Eriksson <[email protected]>2016-02-08 18:00:45 +0100
commit6392637b184ac3172c61025889f3087e5739bb72 (patch)
tree7defce40c56982e16580c15a607dc3e0048a81c2 /erts/emulator/beam/erl_alloc.c
parentfcb5fc90e891d56b83927c8403d97da0faca0e41 (diff)
parente9d6797e15e687828e5ef0d33fb790181d657779 (diff)
downloadotp-6392637b184ac3172c61025889f3087e5739bb72.tar.gz
otp-6392637b184ac3172c61025889f3087e5739bb72.tar.bz2
otp-6392637b184ac3172c61025889f3087e5739bb72.zip
Merge branch 'sverk/thread-unsafe-alloc'
* sverk/thread-unsafe-alloc: erts: Fix faulty assert for non-smp erts: Add checks for thread safe allocation
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r--erts/emulator/beam/erl_alloc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index b53b662a59..806f569c38 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -968,6 +968,10 @@ set_au_allocator(ErtsAlcType_t alctr_n, struct au_init *init, int ncpu)
else
#endif
{
+#ifdef ERTS_SMP
+ erl_exit(ERTS_ABORT_EXIT, "%salloc is not thread safe\n",
+ init->init.util.name_prefix);
+#else
af->alloc = erts_alcu_alloc;
if (init->init.util.fix_type_size)
af->realloc = erts_realloc_fixed_size;
@@ -976,6 +980,7 @@ set_au_allocator(ErtsAlcType_t alctr_n, struct au_init *init, int ncpu)
else
af->realloc = erts_alcu_realloc;
af->free = erts_alcu_free;
+#endif
}
af->extra = NULL;
ai->alloc_util = 1;
@@ -3402,8 +3407,11 @@ UWord erts_alc_test(UWord op, UWord a1, UWord a2, UWord a3)
init.enable = 1;
init.atype = GOODFIT;
init.init.util.name_prefix = (char *) a1;
- init.init.util.ts = a2 ? 1 : 0;
-
+#ifdef ERTS_SMP
+ init.init.util.ts = 1;
+#else
+ init.init.util.ts = a2 ? 1 : 0;
+#endif
if ((char **) a3) {
char **argv = (char **) a3;
int i = 0;