aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-11-29 20:54:14 +0100
committerSverker Eriksson <[email protected]>2016-11-29 20:55:48 +0100
commit6c76bfa96c12b9f29e66baf3a2df7e84bb9b05ef (patch)
tree15005c65554da7654452a9ce3b8e0134f9319a64 /erts/emulator/beam/beam_load.c
parentf7a3650b6827242772f957d624dbb91b5e472744 (diff)
downloadotp-6c76bfa96c12b9f29e66baf3a2df7e84bb9b05ef.tar.gz
otp-6c76bfa96c12b9f29e66baf3a2df7e84bb9b05ef.tar.bz2
otp-6c76bfa96c12b9f29e66baf3a2df7e84bb9b05ef.zip
erts: Refactor BEAM_NIF_MIN_FUNC_SZ
to be declared once in beam_load.h and get rid of #ifdef kludge.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 3cd395c2c1..8f1faa6719 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -2546,15 +2546,10 @@ load_code(LoaderState* stp)
if (stp->may_load_nif) {
const int finfo_ix = ci - FUNC_INFO_SZ;
-#ifdef ERTS_DIRTY_SCHEDULERS
- enum { MIN_FUNC_SZ = 4 };
-#else
- enum { MIN_FUNC_SZ = 3 };
-#endif
- if (finfo_ix - last_func_start < MIN_FUNC_SZ && last_func_start) {
+ if (finfo_ix - last_func_start < BEAM_NIF_MIN_FUNC_SZ && last_func_start) {
/* Must make room for call_nif op */
- int pad = MIN_FUNC_SZ - (finfo_ix - last_func_start);
- ASSERT(pad > 0 && pad < MIN_FUNC_SZ);
+ int pad = BEAM_NIF_MIN_FUNC_SZ - (finfo_ix - last_func_start);
+ ASSERT(pad > 0 && pad < BEAM_NIF_MIN_FUNC_SZ);
CodeNeed(pad);
sys_memmove(&code[finfo_ix+pad], &code[finfo_ix],
FUNC_INFO_SZ*sizeof(BeamInstr));