aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-09-29 16:08:59 +0200
committerBjörn Gustavsson <[email protected]>2011-09-06 11:11:29 +0200
commit9dda912e8d10ca98ced3fc79cf89f2e95a8a2382 (patch)
treee38112fcf21e080ebe3037340722309fda561378 /erts/emulator/beam/erl_process.c
parenteb840a79fd676292b323b82001a6332ca94df879 (diff)
downloadotp-9dda912e8d10ca98ced3fc79cf89f2e95a8a2382.tar.gz
otp-9dda912e8d10ca98ced3fc79cf89f2e95a8a2382.tar.bz2
otp-9dda912e8d10ca98ced3fc79cf89f2e95a8a2382.zip
BEAM: Unify allocation of X and float registers
In the half-word emulator, smp emulator, and non-smp emulator the X register and float register arrays were allocated in different ways. Always allocate the registers and store the pointers to the allocated register arrays in the scheduler data.
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index bbdcf79d00..3a6fe5784a 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -2723,11 +2723,14 @@ erts_init_scheduling(int mrq, int no_schedulers, int no_schedulers_online)
esdp->match_pseudo_process = NULL;
esdp->ssi = ERTS_SCHED_SLEEP_INFO_IX(ix);
esdp->free_process = NULL;
-#if HALFWORD_HEAP
- /* Registers need to be heap allocated (correct memory range) for tracing to work */
- esdp->save_reg = erts_alloc(ERTS_ALC_T_BEAM_REGISTER, ERTS_X_REGS_ALLOCATED * sizeof(Eterm));
-#endif
#endif
+ esdp->x_reg_array =
+ erts_alloc_permanent_cache_aligned(ERTS_ALC_T_BEAM_REGISTER,
+ ERTS_X_REGS_ALLOCATED *
+ sizeof(Eterm));
+ esdp->f_reg_array =
+ erts_alloc_permanent_cache_aligned(ERTS_ALC_T_BEAM_REGISTER,
+ MAX_REG * sizeof(FloatDef));
#if !HEAP_ON_C_STACK
esdp->num_tmp_heap_used = 0;
#endif