aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-08-04 11:32:52 +0200
committerLukas Larsson <[email protected]>2014-08-06 11:44:47 +0200
commitad57501215fc02a39abf3fbce978dbc43d010859 (patch)
tree230d290a4bf8489962329be1c6d7e8b8008a560c /erts/emulator/beam/erl_process.c
parent62081266545df8f5eda8e2043f33055cfe575126 (diff)
downloadotp-ad57501215fc02a39abf3fbce978dbc43d010859.tar.gz
otp-ad57501215fc02a39abf3fbce978dbc43d010859.tar.bz2
otp-ad57501215fc02a39abf3fbce978dbc43d010859.zip
erts: Print error reason when malloc fails
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b73f9b7f92..1606ad119d 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -2211,6 +2211,9 @@ aux_work_timeout_early_init(int no_schedulers)
p = (UWord) malloc((sizeof(ErtsAuxWorkTmo)
+ sizeof(erts_atomic32_t)*(no_schedulers+1))
+ ERTS_CACHE_LINE_SIZE-1);
+ if (!p) {
+ ERTS_INTERNAL_ERROR("malloc failed to allocate memory!");
+ }
if (p & ERTS_CACHE_LINE_MASK)
p = (p & ~ERTS_CACHE_LINE_MASK) + ERTS_CACHE_LINE_SIZE;
ASSERT((p & ERTS_CACHE_LINE_MASK) == 0);
@@ -7818,6 +7821,9 @@ erts_start_schedulers(void)
#ifdef ETHR_HAVE_THREAD_NAMES
opts.name = malloc(80);
+ if (!opts.name) {
+ ERTS_INTERNAL_ERROR("malloc failed to allocate memory!");
+ }
#endif
#ifdef ERTS_SMP