diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-25 18:07:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-25 18:07:58 +0000 |
commit | 89ca4ac7af707d34da190bf469b8073ada175d9b (patch) | |
tree | e9338f678f71d31acd664a643de302ea3bd3289f /ext/B/B.xs | |
parent | 4e1a6d261e266112da00fd82e73dbe2a0631027c (diff) | |
download | perl-89ca4ac7af707d34da190bf469b8073ada175d9b.tar.gz |
Integrate changes #12652 and #12653 from maintperl;
more tweaks to change#12626
* move the boilerplate code over to perl.h and make DynaLoader
use it
* make re, Opcode, File::Glob and B threadsafe
* re.xs needed s/deinstall/uninstall/ (guess nobody uses
C<no re;> anywhere)
include XS_VERSION in MY_CXT_KEY (tweak for change#12652)
File::Glob required a bit more work in bleadperl
because of ExtUtils::Constant (see the Makefile.PL change)
p4raw-link: @12652 on //depot/maint-5.6/perl: 3bc8871b91a24662eada2114d9a016153718b1c4
p4raw-link: @12626 on //depot/maint-5.6/perl: 512dcce54ea4db665708f91609bdd0a6126d1acd
p4raw-id: //depot/perl@12654
p4raw-integrated: from //depot/maint-5.6/perl@12650 'edit in'
ext/B/B.xs ext/DynaLoader/dlutils.c (@12652..) 'merge in'
perl.h (@12597..) ext/File/Glob/Glob.xs ext/Opcode/Opcode.xs
ext/re/re.xs (@12652..)
Diffstat (limited to 'ext/B/B.xs')
-rw-r--r-- | ext/B/B.xs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 0a95d98fa6..b2c163a4eb 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -70,9 +70,17 @@ static char *opclassnames[] = { "B::COP" }; -static int walkoptree_debug = 0; /* Flag for walkoptree debug hook */ +#define MY_CXT_KEY "B::_guts"##XS_VERSION -static SV *specialsv_list[6]; +typedef struct { + int x_walkoptree_debug; /* Flag for walkoptree debug hook */ + SV * x_specialsv_list[6]; +} my_cxt_t; + +START_MY_CXT + +#define walkoptree_debug (MY_CXT.x_walkoptree_debug) +#define specialsv_list (MY_CXT.x_specialsv_list) static opclass cc_opclass(pTHX_ OP *o) @@ -192,6 +200,7 @@ make_sv_object(pTHX_ SV *arg, SV *sv) { char *type = 0; IV iv; + dMY_CXT; for (iv = 0; iv < sizeof(specialsv_list)/sizeof(SV*); iv++) { if (sv == specialsv_list[iv]) { @@ -312,7 +321,8 @@ walkoptree(pTHX_ SV *opsv, char *method) { dSP; OP *o; - + dMY_CXT; + if (!SvROK(opsv)) croak("opsv is not a reference"); opsv = sv_mortalcopy(opsv); @@ -373,6 +383,7 @@ BOOT: { HV *stash = gv_stashpvn("B", 1, TRUE); AV *export_ok = perl_get_av("B::EXPORT_OK",TRUE); + MY_CXT_INIT; specialsv_list[0] = Nullsv; specialsv_list[1] = &PL_sv_undef; specialsv_list[2] = &PL_sv_yes; @@ -440,6 +451,7 @@ walkoptree(opsv, method) int walkoptree_debug(...) CODE: + dMY_CXT; RETVAL = walkoptree_debug; if (items > 0 && SvTRUE(ST(1))) walkoptree_debug = 1; |