aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bif_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-18 16:44:48 +0100
committerSverker Eriksson <[email protected]>2012-02-21 12:22:59 +0100
commitdab78e34dac11579cda578ffc6cf9293394456e4 (patch)
tree37bb3c0c882683051d6d514772daf7f2ae856e70 /erts/emulator/beam/beam_bif_load.c
parentf3b2fc3db73e76323bff1a7f233a8914464b29aa (diff)
downloadotp-dab78e34dac11579cda578ffc6cf9293394456e4.tar.gz
otp-dab78e34dac11579cda578ffc6cf9293394456e4.tar.bz2
otp-dab78e34dac11579cda578ffc6cf9293394456e4.zip
BEAM loader: Break out handling of ranges into beam_ranges.c
Having the entire implementation of range handling (address table) in one source file will help when we'll need to update the ranges without stopping all schedulers in the next commit.
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r--erts/emulator/beam/beam_bif_load.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index 7b17790d3a..8fe11746ee 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -44,7 +44,6 @@ static void decrement_refc(BeamInstr* code);
static int is_native(BeamInstr* code);
static int any_heap_ref_ptrs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size);
static int any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size);
-static void remove_from_address_table(BeamInstr* code);
Eterm
load_module_2(BIF_ALIST_2)
@@ -449,7 +448,7 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2)
modp->curr.code = NULL;
modp->curr.code_length = 0;
modp->curr.catches = BEAM_CATCHES_NIL;
- remove_from_address_table(code);
+ erts_remove_from_ranges(code);
}
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
@@ -754,7 +753,7 @@ purge_module(int module)
modp->old.code = NULL;
modp->old.code_length = 0;
modp->old.catches = BEAM_CATCHES_NIL;
- remove_from_address_table(code);
+ erts_remove_from_ranges(code);
ret = 0;
}
erts_rwunlock_old_code(code_ix);
@@ -780,25 +779,6 @@ decrement_refc(BeamInstr* code)
}
}
-static void
-remove_from_address_table(BeamInstr* code)
-{
- int i;
-
- for (i = 0; i < num_loaded_modules; i++) {
- if (modules[i].start == code) {
- num_loaded_modules--;
- while (i < num_loaded_modules) {
- modules[i] = modules[i+1];
- i++;
- }
- mid_module = &modules[num_loaded_modules/2];
- return;
- }
- }
- ASSERT(0); /* Not found? */
-}
-
/*
* Move code from current to old.