Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
2351-Add-fullsweep_after-support-in-process_fla...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2351-Add-fullsweep_after-support-in-process_flag-2.patch of Package erlang
From 3e19ee1bebeca20b67bdd8350ccdcd03d5d5c667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <lhoguin@vmware.com> Date: Fri, 19 Mar 2021 14:43:14 +0100 Subject: [PATCH] Add fullsweep_after support in process_flag/2 --- erts/doc/src/erlang.xml | 25 ++++++++++++++++++------- erts/emulator/beam/bif.c | 13 +++++++++++++ erts/emulator/test/process_SUITE.erl | 16 ++++++++++++++-- erts/preloaded/src/erlang.erl | 3 +++ 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index ed3a800f02..5a351a2f4a 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5596,7 +5596,18 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="3" + <name name="process_flag" arity="2" clause_i="3" since="OTP 24.0"/> + <fsummary>Set process flag fullsweep_after for the calling process. + </fsummary> + <desc> + <p>Changes the maximum number of generational collections + before forcing a fullsweep for the calling process.</p> + <p>Returns the old value of the flag.</p> + </desc> + </func> + + <func> + <name name="process_flag" arity="2" clause_i="4" anchor="process_flag_min_heap_size" since=""/> <fsummary>Set process flag min_heap_size for the calling process. </fsummary> @@ -5607,7 +5618,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="4" since="OTP R13B04"/> + <name name="process_flag" arity="2" clause_i="5" since="OTP R13B04"/> <fsummary>Set process flag min_bin_vheap_size for the calling process. </fsummary> <desc> @@ -5618,7 +5629,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="5" + <name name="process_flag" arity="2" clause_i="6" anchor="process_flag_max_heap_size" since="OTP 19.0"/> <fsummary>Set process flag max_heap_size for the calling process. </fsummary> @@ -5692,7 +5703,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="6" + <name name="process_flag" arity="2" clause_i="7" anchor="process_flag_message_queue_data" since="OTP 19.0"/> <fsummary>Set process flag message_queue_data for the calling process. </fsummary> @@ -5734,7 +5745,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="7" + <name name="process_flag" arity="2" clause_i="8" anchor="process_flag_priority" since=""/> <fsummary>Set process flag priority for the calling process.</fsummary> <type name="priority_level"/> @@ -5807,7 +5818,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="8" since=""/> + <name name="process_flag" arity="2" clause_i="9" since=""/> <fsummary>Set process flag save_calls for the calling process.</fsummary> <desc> <p><c><anno>N</anno></c> must be an integer in the interval 0..10000. @@ -5838,7 +5849,7 @@ RealSystem = system + MissedSystem</code> </func> <func> - <name name="process_flag" arity="2" clause_i="9" since=""/> + <name name="process_flag" arity="2" clause_i="10" since=""/> <fsummary>Set process flag sensitive for the calling process.</fsummary> <desc> <p>Sets or clears flag <c>sensitive</c> for the current process. diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index af3437c919..d834939cab 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -1854,6 +1854,19 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2) else BIF_RET(old_value); } + else if (BIF_ARG_1 == am_fullsweep_after) { + Sint i; + if (!is_small(BIF_ARG_2)) { + goto error; + } + i = signed_val(BIF_ARG_2); + if (i < 0) { + goto error; + } + old_value = make_small(BIF_P->max_gen_gcs); + BIF_P->max_gen_gcs = i; + BIF_RET(old_value); + } else if (BIF_ARG_1 == am_min_heap_size) { Sint i; if (!is_small(BIF_ARG_2)) { diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index 0e39622540..bacf052f47 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -47,7 +47,8 @@ bump_reductions/1, low_prio/1, binary_owner/1, yield/1, yield2/1, otp_4725/1, dist_unlink_ack_exit_leak/1, bad_register/1, garbage_collect/1, otp_6237/1, - process_info_messages/1, process_flag_badarg/1, process_flag_heap_size/1, + process_info_messages/1, process_flag_badarg/1, + process_flag_fullsweep_after/1, process_flag_heap_size/1, spawn_opt_heap_size/1, spawn_opt_max_heap_size/1, more_spawn_opt_max_heap_size/1, processes_large_tab/1, processes_default_tab/1, processes_small_tab/1, @@ -106,7 +107,8 @@ all() -> bump_reductions, low_prio, yield, yield2, otp_4725, dist_unlink_ack_exit_leak, bad_register, garbage_collect, process_info_messages, - process_flag_badarg, process_flag_heap_size, + process_flag_badarg, + process_flag_fullsweep_after, process_flag_heap_size, spawn_opt_heap_size, spawn_opt_max_heap_size, more_spawn_opt_max_heap_size, spawn_huge_arglist, @@ -1595,6 +1597,7 @@ process_flag_badarg(Config) when is_list(Config) -> chk_badarg(fun () -> process_flag(gurka, banan) end), chk_badarg(fun () -> process_flag(trap_exit, gurka) end), chk_badarg(fun () -> process_flag(error_handler, 1) end), + chk_badarg(fun () -> process_flag(fullsweep_after, gurka) end), chk_badarg(fun () -> process_flag(min_heap_size, gurka) end), chk_badarg(fun () -> process_flag(min_bin_vheap_size, gurka) end), chk_badarg(fun () -> process_flag(min_bin_vheap_size, -1) end), @@ -2213,6 +2216,15 @@ processes_gc_trap(Config) when is_list(Config) -> exit(Suspendee, bang), ok. +process_flag_fullsweep_after(Config) when is_list(Config) -> + {fullsweep_after, OldFSA} = process_info(self(), fullsweep_after), + OldFSA = process_flag(fullsweep_after, 12345), + {fullsweep_after, 12345} = process_info(self(), fullsweep_after), + 12345 = process_flag(fullsweep_after, 0), + {fullsweep_after, 0} = process_info(self(), fullsweep_after), + 0 = process_flag(fullsweep_after, OldFSA), + ok. + process_flag_heap_size(Config) when is_list(Config) -> HSize = 2586, % must be gc fib+ number VHSize = 318187, % must be gc fib+ number diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 2983966ade..e0f216ca5e 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -2359,6 +2359,9 @@ open_port(PortName, PortSettings) -> (error_handler, Module) -> OldModule when Module :: atom(), OldModule :: atom(); + (fullsweep_after, FullsweepAfter) -> OldFullsweepAfter when + FullsweepAfter :: non_neg_integer(), + OldFullsweepAfter :: non_neg_integer(); (min_heap_size, MinHeapSize) -> OldMinHeapSize when MinHeapSize :: non_neg_integer(), OldMinHeapSize :: non_neg_integer(); -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor