From: Doug MacEachern Date: Sun, 9 Jun 2002 16:49:25 +0000 (-0700) Subject: Re: unique attribute? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59b4066285adfb32f43328ed52e37356d33be015;p=p5sagit%2Fp5-mst-13.2.git Re: unique attribute? Message-ID: p4raw-id: //depot/perl@17153 --- diff --git a/embed.fnc b/embed.fnc index 48c8090..fb4a504 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 805fd0d..9f8605a 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 aafb94f..e201596 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 d139ccf..da051f7 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 = ¶m->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 6f95c46..39441b4 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; };