summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_process.h
diff options
context:
space:
mode:
authorRickard Green <rickard@erlang.org>2021-04-15 19:22:12 +0200
committerRickard Green <rickard@erlang.org>2021-04-27 13:10:37 +0200
commitae41aa141ea6a09af33a022c5964ad24708419cd (patch)
tree9efe7b0f88788c844d90b7bf4249cfa21194601d /erts/emulator/beam/erl_process.h
parenta819f99cad0f7cf808eeae27d6b7590a4e83ab33 (diff)
downloaderlang-ae41aa141ea6a09af33a022c5964ad24708419cd.tar.gz
Prepare for literals in non-message signals
Previously references to literals could only exist in non-message signals. We, however, at least need to allow literals in messages passed using the alias-message signal, but also other non-message signals, such as for example exit signals, should be able to contain literals. The most straightforward idea would be to handle all types of signals that can contain literals. This however become quite complicated since there are a lot of different signals with different layouts. Instead of this we pass copy-literal-area signals to all processes after having set the specific area as "copy literal area". All new signals being created, after the area has been set, will copy the literals on creation and will therefore not contain any references to the area being released. When the copy-literal-area signal is received any references to the literal area will either have been dropped or converted into messages placed in the message queue. That is, at this point only the message queue has to be inspected. By this we don't have to take care of a lot of different signal types. Also when introducing new signal types carrying literals we wont have to bother about this. When the copy-literal-area signal is received, the message queue is checked and any literals are copied into the messages. After that the heap is scanned for references to the literal area. If references to the area are found, a request for literal GC is sent as reply to the literal-area-collector process; otherwise, a confirmation that the process is clean is sent as reply. The copy-literal signal is prepared so it can be reused when sending the reply message to the literal-area-collector process. By this we significantly reduce the amount of allocations made for the whole literal GC operation. If a literal GC is needed, this will be scheduled as a system task at a later time by the copy-literal-collector process when appropriate (using the same approach as before).
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r--erts/emulator/beam/erl_process.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index dfd3549391..447acc1974 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -1906,6 +1906,7 @@ void erts_schedule_thr_prgr_later_cleanup_op(void (*)(void *),
ErtsThrPrgrLaterOp *,
UWord);
void erts_schedule_complete_off_heap_message_queue_change(Eterm pid);
+void erts_schedule_cla_gc(Process *c_p, Eterm to, Eterm req_id);
struct db_fixation;
void erts_schedule_ets_free_fixation(Eterm pid, struct db_fixation*);
void erts_schedule_flush_trace_messages(Process *proc, int force_on_proc);