diff options
author | Lukas Larsson <[email protected]> | 2014-08-08 11:51:27 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2014-08-08 11:51:27 +0200 |
commit | 2525622c384b27581c4b4cb158fc951f15ac5ca3 (patch) | |
tree | 15c62ac68a08fe211e5663212e0d8fbdbed0d8f2 /erts/emulator/beam/erl_process.c | |
parent | bf4d615f04002aebca4e340f9fa0aaf3888e84e2 (diff) | |
parent | ad57501215fc02a39abf3fbce978dbc43d010859 (diff) | |
download | otp-2525622c384b27581c4b4cb158fc951f15ac5ca3.tar.gz otp-2525622c384b27581c4b4cb158fc951f15ac5ca3.tar.bz2 otp-2525622c384b27581c4b4cb158fc951f15ac5ca3.zip |
Merge branch 'lukas/erts/malloc_failure_errors/OTP-12085' into maint
* lukas/erts/malloc_failure_errors/OTP-12085:
erts: Print error reason when malloc fails
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r-- | erts/emulator/beam/erl_process.c | 6 |
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 |