aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/module.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-01-31 14:24:40 +0100
committerSverker Eriksson <[email protected]>2012-02-21 12:23:05 +0100
commit7cb4725bcf18f3158e60750ea658e51ab4586e31 (patch)
treecf54f04beb607f84ce5353d48ac9000d337e6820 /erts/emulator/beam/module.c
parent6b97a90f2314b66f4f41b14a986a9c1f1ebebf13 (diff)
downloadotp-7cb4725bcf18f3158e60750ea658e51ab4586e31.tar.gz
otp-7cb4725bcf18f3158e60750ea658e51ab4586e31.tar.bz2
otp-7cb4725bcf18f3158e60750ea658e51ab4586e31.zip
erts: Refactor code_ix
Move implementation from beam_load into new file code_ix.c and module.c and make some function inline.
Diffstat (limited to 'erts/emulator/beam/module.c')
-rw-r--r--erts/emulator/beam/module.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/module.c b/erts/emulator/beam/module.c
index 26c73fff1a..d3fd3f118d 100644
--- a/erts/emulator/beam/module.c
+++ b/erts/emulator/beam/module.c
@@ -37,6 +37,8 @@
static IndexTable module_tables[ERTS_NUM_CODE_IX];
+erts_smp_rwmtx_t the_old_code_rwlocks[ERTS_NUM_CODE_IX];
+
/*
* SMP note: We don't need to look accesses to the module table because
* there is one only scheduler thread when we update it.
@@ -100,6 +102,10 @@ void init_module_table(void)
erts_index_init(ERTS_ALC_T_MODULE_TABLE, &module_tables[i], "module_code",
MODULE_SIZE, MODULE_LIMIT, f);
}
+
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ erts_smp_rwmtx_init_x(&the_old_code_rwlocks[i], "old_code", make_small(i));
+ }
}
Module*
@@ -211,3 +217,4 @@ void module_end_staging(int commit)
IF_DEBUG(dbg_load_code_ix = -1);
}
+