aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_init.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-08-29 17:52:10 +0200
committerRickard Green <[email protected]>2016-08-29 17:52:10 +0200
commit928d74ffa09bd56652d9390b02fa51ef51d71d51 (patch)
treebfb9cd9e76d4ef766dbcd999adf16c700350b399 /erts/emulator/beam/erl_init.c
parent69d442f8afc67aef33c70d68d7eaab2bdad1400f (diff)
parent9d0638216d35ca0f21c1eea20f8daa3992ac4f71 (diff)
downloadotp-928d74ffa09bd56652d9390b02fa51ef51d71d51.tar.gz
otp-928d74ffa09bd56652d9390b02fa51ef51d71d51.tar.bz2
otp-928d74ffa09bd56652d9390b02fa51ef51d71d51.zip
Merge branch 'rickard/fun-purge-bug/OTP-13809' and 'rickard/new-purge-strategy/OTP-13833' into maint
* rickard/fun-purge-bug/OTP-13809: Fix purge of code Reclaim literal area after purge has completed Separate literal area from code Conflicts: erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/erl_init.c erts/preloaded/ebin/init.beam
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r--erts/emulator/beam/erl_init.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 07cfacf14a..8afda42a71 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -382,6 +382,7 @@ erl_init(int ncpu,
erts_init_unicode(); /* after RE to get access to PCRE unicode */
erts_init_external();
erts_init_map();
+ erts_beam_bif_load_init();
erts_delay_trap = erts_export_put(am_erlang, am_delay_trap, 2);
erts_late_init_process();
#if HAVE_ERTS_MSEG
@@ -2248,7 +2249,32 @@ erl_start(int argc, char **argv)
otp_ring0_pid = erl_first_process_otp("otp_ring0", NULL, 0,
boot_argc, boot_argv);
- (void) erl_system_process_otp(otp_ring0_pid, "erts_code_purger");
+ {
+ /*
+ * The erts_code_purger and the erts_literal_area_collector
+ * system processes are *always* alive. If they terminate
+ * they bring the whole VM down.
+ */
+ Eterm pid;
+
+ pid = erl_system_process_otp(otp_ring0_pid, "erts_code_purger");
+ erts_code_purger
+ = (Process *) erts_ptab_pix2intptr_ddrb(&erts_proc,
+ internal_pid_index(pid));
+ ASSERT(erts_code_purger && erts_code_purger->common.id == pid);
+ erts_proc_inc_refc(erts_code_purger);
+
+#ifdef ERTS_NEW_PURGE_STRATEGY
+ pid = erl_system_process_otp(otp_ring0_pid, "erts_literal_area_collector");
+ erts_literal_area_collector
+ = (Process *) erts_ptab_pix2intptr_ddrb(&erts_proc,
+ internal_pid_index(pid));
+ ASSERT(erts_literal_area_collector
+ && erts_literal_area_collector->common.id == pid);
+ erts_proc_inc_refc(erts_literal_area_collector);
+#endif
+
+ }
#ifdef ERTS_SMP
erts_start_schedulers();