summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2002-06-09 09:49:25 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-09 23:25:04 +0000
commit59b4066285adfb32f43328ed52e37356d33be015 (patch)
tree3a016bc5c1debdf941b87869ae7e1ec06eef7e92
parentb238e82634f7c3c5500709c523a925d0d03b1f42 (diff)
downloadperl-59b4066285adfb32f43328ed52e37356d33be015.tar.gz
Re: unique attribute?
Message-ID: <Pine.LNX.4.33.0206091645330.26891-100000@mako.covalent.net> p4raw-id: //depot/perl@17153
-rw-r--r--embed.fnc2
-rw-r--r--embed.h2
-rw-r--r--proto.h2
-rw-r--r--sv.c7
-rw-r--r--sv.h1
5 files changed, 8 insertions, 6 deletions
diff --git a/embed.fnc b/embed.fnc
index 48c8090fb8..fb4a5048e6 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1242,7 +1242,7 @@ s |int |sv_2iuv_non_preserve |SV *sv|I32 numtype
s |I32 |expect_number |char** pattern
#
# if defined(USE_ITHREADS)
-s |SV* |gv_share |SV *sv
+s |SV* |gv_share |SV *sv|CLONE_PARAMS *param
# endif
#endif
diff --git a/embed.h b/embed.h
index 805fd0def2..9f8605a38b 100644
--- a/embed.h
+++ b/embed.h
@@ -2671,7 +2671,7 @@
# endif
#define expect_number(a) S_expect_number(aTHX_ a)
# if defined(USE_ITHREADS)
-#define gv_share(a) S_gv_share(aTHX_ a)
+#define gv_share(a,b) S_gv_share(aTHX_ a,b)
# endif
#endif
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
diff --git a/proto.h b/proto.h
index aafb94f6c8..e201596cf1 100644
--- a/proto.h
+++ b/proto.h
@@ -1275,7 +1275,7 @@ STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv, I32 numtype);
STATIC I32 S_expect_number(pTHX_ char** pattern);
#
# if defined(USE_ITHREADS)
-STATIC SV* S_gv_share(pTHX_ SV *sv);
+STATIC SV* S_gv_share(pTHX_ SV *sv, CLONE_PARAMS *param);
# endif
#endif
diff --git a/sv.c b/sv.c
index d139ccf175..da051f7a68 100644
--- a/sv.c
+++ b/sv.c
@@ -8859,10 +8859,10 @@ char *PL_watch_pvx;
/* attempt to make everything in the typeglob readonly */
STATIC SV *
-S_gv_share(pTHX_ SV *sstr)
+S_gv_share(pTHX_ SV *sstr, CLONE_PARAMS *param)
{
GV *gv = (GV*)sstr;
- SV *sv = &PL_sv_no; /* just need SvREADONLY-ness */
+ SV *sv = &param->proto_perl->Isv_no; /* just need SvREADONLY-ness */
if (GvIO(gv) || GvFORM(gv)) {
GvUNIQUE_off(gv); /* GvIOs cannot be shared. nor can GvFORMs */
@@ -9053,7 +9053,7 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param)
case SVt_PVGV:
if (GvUNIQUE((GV*)sstr)) {
SV *share;
- if ((share = gv_share(sstr))) {
+ if ((share = gv_share(sstr, param))) {
del_SV(dstr);
dstr = share;
ptr_table_store(PL_ptr_table, sstr, dstr);
@@ -9759,6 +9759,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
# endif /* DEBUGGING */
#endif /* PERL_IMPLICIT_SYS */
param->flags = flags;
+ param->proto_perl = proto_perl;
/* arena roots */
PL_xiv_arenaroot = NULL;
diff --git a/sv.h b/sv.h
index 6f95c46a84..39441b41dc 100644
--- a/sv.h
+++ b/sv.h
@@ -1206,4 +1206,5 @@ Returns a pointer to the character buffer.
struct clone_params {
AV* stashes;
UV flags;
+ PerlInterpreter *proto_perl;
};