aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaos S. Papaspyrou <[email protected]>2012-06-09 01:37:29 +0300
committerBjörn-Egil Dahlberg <[email protected]>2015-11-17 14:45:45 +0100
commit244e9d5855d1b1f160d667b5cf369defee72829d (patch)
tree4b065a04569220705900d4e882d2a220b1dc6000
parent8d02ad60c88aa060ff83ff3179bc8c0ab66868ee (diff)
downloadotp-244e9d5855d1b1f160d667b5cf369defee72829d.tar.gz
otp-244e9d5855d1b1f160d667b5cf369defee72829d.tar.bz2
otp-244e9d5855d1b1f160d667b5cf369defee72829d.zip
Enable shcopy for spawning processes
-rw-r--r--erts/emulator/beam/erl_process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 9acce8acb6..f2da5289d3 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -10747,6 +10747,11 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
Eterm res = THE_NON_VALUE;
erts_aint32_t state = 0;
erts_aint32_t prio = (erts_aint32_t) PRIORITY_NORMAL;
+#ifdef SHCOPY_SPAWN
+ unsigned shflags = 0; /* could be taken from so->flags, if necessary */
+ shcopy_info info;
+ INITIALIZE_INFO(info);
+#endif
#ifdef ERTS_SMP
erts_smp_proc_lock(parent, ERTS_PROC_LOCKS_ALL_MINOR);
@@ -10798,7 +10803,11 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
BM_COUNT(processes_spawned);
BM_SWAP_TIMER(system,size);
+#ifdef SHCOPY_SPAWN
+ arg_size = copy_shared_calculate(args, &info, shflags);
+#else
arg_size = size_object(args);
+#endif
BM_SWAP_TIMER(size,system);
heap_need = arg_size;
@@ -10876,7 +10885,12 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
BM_MESSAGE(args,p,parent);
BM_START_TIMER(system);
BM_SWAP_TIMER(system,copy);
+#ifdef SHCOPY_SPAWN
+ p->arg_reg[2] = copy_shared_perform(args, arg_size, &info, &p->htop, &p->off_heap, shflags);
+ DESTROY_INFO(info);
+#else
p->arg_reg[2] = copy_struct(args, arg_size, &p->htop, &p->off_heap);
+#endif
BM_MESSAGE_COPIED(arg_size);
BM_SWAP_TIMER(copy,system);
p->arity = 3;
@@ -11260,6 +11274,8 @@ static void
delete_process(Process* p)
{
VERBOSE(DEBUG_PROCESSES, ("Removing process: %T\n",p->common.id));
+ VERBOSE_DEBUG("[pid=%T] delete process: %p %p %p %p\n", p->common.id,
+ HEAP_START(p), HEAP_END(p), OLD_HEAP(p), OLD_HEND(p));
/* Cleanup psd */