summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2002-12-16 21:41:40 +0000
committerArtur Bergman <sky@nanisky.com>2002-12-16 21:41:40 +0000
commit6a78b4db838997434df520d6d78be1e74fd2a70c (patch)
tree3bc00f1005e4b7d7a59398b7ef0c6c2cb940dbf1 /sv.c
parent123f32c0e4e1154f54984e59e57611e93b9f359a (diff)
downloadperl-6a78b4db838997434df520d6d78be1e74fd2a70c.tar.gz
More documentation of obscure flags is good, even if the
documentation might be not so good. Atleast it's not false! Documents the flags one can give to perl_clone p4raw-id: //depot/perl@18306
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index a21cedf50e..d4785830f6 100644
--- a/sv.c
+++ b/sv.c
@@ -10046,6 +10046,35 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
Create and return a new interpreter by cloning the current one.
+perl_clone takes these flags as paramters:
+
+CLONEf_COPY_STACKS - is used to, well, copy the stacks also,
+without it we only clone the data and zero the stacks,
+with it we copy the stacks and the new perl interpreter is
+ready to run at the exact same point as the previous one.
+The pseudo-fork code uses COPY_STACKS while the
+threads->new doesn't.
+
+CLONEf_KEEP_PTR_TABLE
+perl_clone keeps a ptr_table with the pointer of the old
+variable as a key and the new variable as a value,
+this allows it to check if something has been cloned and not
+clone it again but rather just use the value and increase the
+refcount. If KEEP_PTR_TABLE is not set then perl_clone will kill
+the ptr_table using the function
+C<ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;>,
+reason to keep it around is if you want to dup some of your own
+variable who are outside the graph perl scans, example of this
+code is in threads.xs create
+
+CLONEf_CLONE_HOST
+This is a win32 thing, it is ignored on unix, it tells perls
+win32host code (which is c++) to clone itself, this is needed on
+win32 if you want to run two threads at the same time,
+if you just want to do some stuff in a separate perl interpreter
+and then throw it away and return to the original one,
+you don't need to do anything.
+
=cut
*/