diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-11-23 15:12:28 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-11-23 15:12:28 +0100 |
commit | 9d2acfb6ad3184c150a9e91520cd320c83e952b4 (patch) | |
tree | 7e2cf822f46948aabeb59b85f0639d0f25249537 /lib | |
parent | ab1bf8631008ea62443366125c6932db2e2af69a (diff) | |
parent | 6ff15f23c68db356bbad6ab5f939c191b58d453d (diff) | |
download | otp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.tar.gz otp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.tar.bz2 otp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.zip |
Merge branch 'np/sharing-preserved-copy/OTP-12590'
* np/sharing-preserved-copy/OTP-12590: (28 commits)
Refactor have seq_trace token test
Use sharing preserving copy error messages and exceptions
Use sharing preserving copy in enif_make_copy
Refactor sharing preserved copy flags
Fix rebase of SHCOPY seq_tokens
Fix erts_debug:copy_shared/1 prototype
Update preloaded module erlang.beam
Add erlang:copy_literals/2 spec
Add copy_literals testcase
Do not use GCC extensions in copy
Use copy literal range check in message passing and purging
Add BIF for setting internal copy literal range
Copy literals in copy sharing
Refactor copy sharing
Add support for HAMT maps in preserved copy
Fix Map preserved sharing copy implementation
Fix Halfword removal
Fix internal stacks
Add support for maps in preserved copy
Add --enable-sharing-preserving configure flag
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/src/code_server.erl | 25 | ||||
-rw-r--r-- | lib/kernel/src/erts_debug.erl | 15 |
2 files changed, 29 insertions, 11 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index e461c95d19..68dd21b1d7 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -1428,16 +1428,18 @@ absname_vr([[X, $:]|Name], _, _AbsBase) -> do_purge(Mod0) -> Mod = to_atom(Mod0), case erlang:check_old_code(Mod) of - false -> - false; - true -> - Res = check_proc_code(erlang:processes(), Mod, true), - try - erlang:purge_module(Mod) - catch - _:_ -> ignore - end, - Res + false -> + false; + true -> + true = erlang:copy_literals(Mod, true), + Res = check_proc_code(erlang:processes(), Mod, true), + true = erlang:copy_literals(Mod, false), + try + erlang:purge_module(Mod) + catch + _:_ -> ignore + end, + Res end. %% do_soft_purge(Module) @@ -1451,10 +1453,13 @@ do_soft_purge(Mod0) -> false -> true; true -> + true = erlang:copy_literals(Mod, true), case check_proc_code(erlang:processes(), Mod, false) of false -> + true = erlang:copy_literals(Mod, false), false; true -> + true = erlang:copy_literals(Mod, false), try erlang:purge_module(Mod) catch diff --git a/lib/kernel/src/erts_debug.erl b/lib/kernel/src/erts_debug.erl index 39308c0043..87f001fdf4 100644 --- a/lib/kernel/src/erts_debug.erl +++ b/lib/kernel/src/erts_debug.erl @@ -34,7 +34,8 @@ -export([breakpoint/2, disassemble/1, display/1, dist_ext_to_term/2, dump_monitors/1, dump_links/1, flat_size/1, get_internal_state/1, instructions/0, lock_counters/1, - map_info/1, same/2, set_internal_state/2]). + map_info/1, same/2, set_internal_state/2, + size_shared/1, copy_shared/1]). -spec breakpoint(MFA, Flag) -> non_neg_integer() when MFA :: {Module :: module(), @@ -86,6 +87,18 @@ dump_links(_) -> flat_size(_) -> erlang:nif_error(undef). +-spec size_shared(Term) -> non_neg_integer() when + Term :: term(). + +size_shared(_) -> + erlang:nif_error(undef). + +-spec copy_shared(Term) -> term() when + Term :: term(). + +copy_shared(_) -> + erlang:nif_error(undef). + -spec get_internal_state(W) -> term() when W :: reds_left | node_and_dist_references | monitoring_nodes | next_pid | 'DbTable_words' | check_io_debug |