diff options
author | Lukas Larsson <[email protected]> | 2018-10-10 10:42:11 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-12-03 13:27:16 +0100 |
commit | 33324fd140998f36698145d2eea7e8722c044740 (patch) | |
tree | be49d846e4b8f4502257f88ac8b6310578e7f331 /erts | |
parent | 4047f7177835928f2205fb728c65247ea68d5d59 (diff) | |
download | otp-33324fd140998f36698145d2eea7e8722c044740.tar.gz otp-33324fd140998f36698145d2eea7e8722c044740.tar.bz2 otp-33324fd140998f36698145d2eea7e8722c044740.zip |
erts: Add pre-alloc to ALLOC msacc state
OTP-15450
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/erl_sched_spec_pre_alloc.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.h b/erts/emulator/beam/erl_sched_spec_pre_alloc.h index b119c59ab3..74cc966cbe 100644 --- a/erts/emulator/beam/erl_sched_spec_pre_alloc.h +++ b/erts/emulator/beam/erl_sched_spec_pre_alloc.h @@ -188,6 +188,7 @@ erts_sspa_alloc(erts_sspa_data_t *data, int cix) erts_sspa_chunk_t *chnk; erts_sspa_chunk_header_t *chdr; erts_sspa_blk_t *res; + ERTS_MSACC_PUSH_AND_SET_STATE_M_X(ERTS_MSACC_STATE_ALLOC); chnk = erts_sspa_cix2chunk(data, cix); chdr = &chnk->aligned.header; @@ -201,11 +202,15 @@ erts_sspa_alloc(erts_sspa_data_t *data, int cix) chdr->local.last = NULL; ERTS_SSPA_DBG_CHK_LCL(chdr); } - if (chdr->local.cnt <= chdr->local.lim) - return (char *) erts_sspa_process_remote_frees(chdr, res); + if (chdr->local.cnt <= chdr->local.lim) { + res = erts_sspa_process_remote_frees(chdr, res); + ERTS_MSACC_POP_STATE_M_X(); + return (char*) res; + } else if (chdr->head.no_thr_progress_check < ERTS_SSPA_FORCE_THR_CHECK_PROGRESS) chdr->head.no_thr_progress_check++; ASSERT(res); + ERTS_MSACC_POP_STATE_M_X(); return (char *) res; } |