diff options
author | Vincent Pit <perl@profvince.com> | 2009-07-25 00:15:07 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-07-25 23:26:06 +0200 |
commit | 91d1c79f6c648258e3465cf0cdbe8df3ab262de1 (patch) | |
tree | 80fc2bb47eae65d7017d956e3759daf004420d29 | |
parent | 2788925507d099c7b1e9382ad2ddc4f3d692de28 (diff) | |
download | perl-91d1c79f6c648258e3465cf0cdbe8df3ab262de1.tar.gz |
Introduce save_aelem_flags()
It's the symmetric of save_helem_flags(). save_aelem() is now a macro wrapping around save_aelem_flags().
-rw-r--r-- | embed.fnc | 3 | ||||
-rw-r--r-- | embed.h | 4 | ||||
-rw-r--r-- | global.sym | 2 | ||||
-rw-r--r-- | proto.h | 8 | ||||
-rw-r--r-- | scope.c | 6 | ||||
-rw-r--r-- | scope.h | 1 |
6 files changed, 15 insertions, 9 deletions
@@ -882,7 +882,8 @@ Apda |char* |savesharedpvn |NN const char *const pv|const STRLEN len Apda |char* |savesvpv |NN SV* sv Ap |void |savestack_grow Ap |void |savestack_grow_cnt |I32 need -Ap |void |save_aelem |NN AV* av|I32 idx|NN SV **sptr +Amp |void |save_aelem |NN AV* av|I32 idx|NN SV **sptr +Ap |void |save_aelem_flags|NN AV* av|I32 idx|NN SV **sptr|const U32 flags Ap |I32 |save_alloc |I32 size|I32 pad Ap |void |save_aptr |NN AV** aptr Ap |AV* |save_ary |NN GV* gv @@ -773,7 +773,7 @@ #define savesvpv Perl_savesvpv #define savestack_grow Perl_savestack_grow #define savestack_grow_cnt Perl_savestack_grow_cnt -#define save_aelem Perl_save_aelem +#define save_aelem_flags Perl_save_aelem_flags #define save_alloc Perl_save_alloc #define save_aptr Perl_save_aptr #define save_ary Perl_save_ary @@ -3111,7 +3111,7 @@ #define savesvpv(a) Perl_savesvpv(aTHX_ a) #define savestack_grow() Perl_savestack_grow(aTHX) #define savestack_grow_cnt(a) Perl_savestack_grow_cnt(aTHX_ a) -#define save_aelem(a,b,c) Perl_save_aelem(aTHX_ a,b,c) +#define save_aelem_flags(a,b,c,d) Perl_save_aelem_flags(aTHX_ a,b,c,d) #define save_alloc(a,b) Perl_save_alloc(aTHX_ a,b) #define save_aptr(a) Perl_save_aptr(aTHX_ a) #define save_ary(a) Perl_save_ary(aTHX_ a) diff --git a/global.sym b/global.sym index 474e6bb307..73bf5be818 100644 --- a/global.sym +++ b/global.sym @@ -433,7 +433,7 @@ Perl_savesharedpvn Perl_savesvpv Perl_savestack_grow Perl_savestack_grow_cnt -Perl_save_aelem +Perl_save_aelem_flags Perl_save_alloc Perl_save_aptr Perl_save_ary @@ -2746,10 +2746,14 @@ PERL_CALLCONV char* Perl_savesvpv(pTHX_ SV* sv) PERL_CALLCONV void Perl_savestack_grow(pTHX); PERL_CALLCONV void Perl_savestack_grow_cnt(pTHX_ I32 need); -PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr) +/* PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr) + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_3); */ + +PERL_CALLCONV void Perl_save_aelem_flags(pTHX_ AV* av, I32 idx, SV **sptr, const U32 flags) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_3); -#define PERL_ARGS_ASSERT_SAVE_AELEM \ +#define PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS \ assert(av); assert(sptr) PERL_CALLCONV I32 Perl_save_alloc(pTHX_ I32 size, I32 pad); @@ -572,12 +572,12 @@ S_save_pushptri32ptr(pTHX_ void *const ptr1, const I32 i, void *const ptr2, } void -Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr) +Perl_save_aelem_flags(pTHX_ AV *av, I32 idx, SV **sptr, const U32 flags) { dVAR; SV *sv; - PERL_ARGS_ASSERT_SAVE_AELEM; + PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS; SvGETMAGIC(*sptr); save_pushptri32ptr(SvREFCNT_inc_simple(av), idx, SvREFCNT_inc(*sptr), @@ -585,7 +585,7 @@ Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr) /* if it gets reified later, the restore will have the wrong refcnt */ if (!AvREAL(av) && AvREIFY(av)) SvREFCNT_inc_void(*sptr); - save_scalar_at(sptr, SAVEf_SETMAGIC); /* XXX - FIXME - see #60360 */ + save_scalar_at(sptr, flags); /* XXX - FIXME - see #60360 */ sv = *sptr; /* If we're localizing a tied array element, this new sv * won't actually be stored in the array - so it won't get @@ -58,6 +58,7 @@ #define SAVEf_SETMAGIC 1 +#define save_aelem(av,idx,sptr) save_aelem_flags(av,idx,sptr,SAVEf_SETMAGIC) #define save_helem(hv,key,sptr) save_helem_flags(hv,key,sptr,SAVEf_SETMAGIC) #ifndef SCOPE_SAVES_SIGNAL_MASK |