Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
3741-erts-Add-erts_debug-copy_shared-2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3741-erts-Add-erts_debug-copy_shared-2.patch of Package erlang
From 69383a0555e83fb31f1086bda132622f4469ee5a Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Wed, 13 Oct 2021 16:17:45 +0200 Subject: [PATCH 1/2] erts: Add erts_debug:copy_shared/2 with CopyLiterals boolean argument. --- erts/emulator/beam/beam_debug.c | 9 ++++++++- erts/emulator/beam/bif.tab | 2 +- lib/kernel/src/erts_debug.erl | 12 ++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index a50ec46659..f8bc2af783 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -96,7 +96,7 @@ erts_debug_size_shared_1(BIF_ALIST_1) } BIF_RETTYPE -erts_debug_copy_shared_1(BIF_ALIST_1) +erts_debug_copy_shared_2(BIF_ALIST_2) { Process* p = BIF_P; Eterm term = BIF_ARG_1; @@ -106,6 +106,13 @@ erts_debug_copy_shared_1(BIF_ALIST_1) erts_shcopy_t info; INITIALIZE_SHCOPY(info); + switch (BIF_ARG_2) { + case am_true: info.copy_literals = 1; break; + case am_false: info.copy_literals = 0; break; + default: + BIF_ERROR(p, BADARG); + } + size = copy_shared_calculate(term, &info); if (size > 0) { hp = HAlloc(p, size); diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab index 9ba49376dd..b460842049 100644 --- a/erts/emulator/beam/bif.tab +++ b/erts/emulator/beam/bif.tab @@ -665,7 +665,7 @@ bif erts_internal:purge_module/2 bif binary:split/2 bif binary:split/3 bif erts_debug:size_shared/1 -bif erts_debug:copy_shared/1 +bif erts_debug:copy_shared/2 bif erlang:has_prepared_code_on_load/1 bif maps:take/2 diff --git a/lib/kernel/src/erts_debug.erl b/lib/kernel/src/erts_debug.erl index b14dcadd4d..06d91d5faf 100644 --- a/lib/kernel/src/erts_debug.erl +++ b/lib/kernel/src/erts_debug.erl @@ -35,7 +35,8 @@ flat_size/1, get_internal_state/1, instructions/0, interpreter_size/0, map_info/1, same/2, set_internal_state/2, - size_shared/1, copy_shared/1, dirty_cpu/2, dirty_io/2, dirty/3, + size_shared/1, copy_shared/1, copy_shared/2, + dirty_cpu/2, dirty_io/2, dirty/3, lcnt_control/1, lcnt_control/2, lcnt_collect/0, lcnt_clear/0, lc_graph/0, lc_graph_to_dot/2, lc_graph_merge/2, alloc_blocks_size/1]). @@ -96,7 +97,14 @@ size_shared(_) -> -spec copy_shared(Term) -> term() when Term :: term(). -copy_shared(_) -> +copy_shared(Term) -> + copy_shared(Term, false). + +-spec copy_shared(Term, CopyLiterals) -> term() when + Term :: term(), + CopyLiterals :: true | false. + +copy_shared(_, _) -> erlang:nif_error(undef). -spec get_internal_state(W) -> term() when -- 2.31.1
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