aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-10-22 17:15:31 +0200
committerLukas Larsson <[email protected]>2016-02-02 10:45:21 +0100
commitd76ee58c07f32dfc0652844ec2b513af2105ffa1 (patch)
treeac6d50ec60414c7433508196410b22216493209d /erts/emulator/beam/erl_alloc.c
parent1a6ec7c7eb20bb2b8300e7e59196c49ca63775b0 (diff)
downloadotp-d76ee58c07f32dfc0652844ec2b513af2105ffa1.tar.gz
otp-d76ee58c07f32dfc0652844ec2b513af2105ffa1.tar.bz2
otp-d76ee58c07f32dfc0652844ec2b513af2105ffa1.zip
erts: Add ERTS_WRITE_UNLIKELY
ERTS_WRITE_UNLIKELY can be used to place global variables in a specific section where only data that is very rarely modified sits. This is used to improve cache locality.
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r--erts/emulator/beam/erl_alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 5544712e8d..51b522c9e0 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -103,9 +103,9 @@ static Uint install_debug_functions(void);
static int lock_all_physical_memory = 0;
-ErtsAllocatorFunctions_t erts_allctrs[ERTS_ALC_A_MAX+1];
+ErtsAllocatorFunctions_t ERTS_WRITE_UNLIKELY(erts_allctrs[ERTS_ALC_A_MAX+1]);
ErtsAllocatorInfo_t erts_allctrs_info[ERTS_ALC_A_MAX+1];
-ErtsAllocatorThrSpec_t erts_allctr_thr_spec[ERTS_ALC_A_MAX+1];
+ErtsAllocatorThrSpec_t ERTS_WRITE_UNLIKELY(erts_allctr_thr_spec[ERTS_ALC_A_MAX+1]);
#define ERTS_MIN(A, B) ((A) < (B) ? (A) : (B))
#define ERTS_MAX(A, B) ((A) > (B) ? (A) : (B))