X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=scope.h;h=c1fa4f96568d05ea7ba7e2ae6e0d412f0f23cff3;hb=d10ced8a0718a50590450dfb6f8db4eb7511a2e4;hp=42d1617eb9d5e041af1639ee30887c5818945b39;hpb=699a97de988b5b9b54375d79201e72f1c259685c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/scope.h b/scope.h index 42d1617..c1fa4f9 100644 --- a/scope.h +++ b/scope.h @@ -1,7 +1,7 @@ /* scope.h * - * Copyright (C) 1993, 1994, 1996, 1997, 1998, 1999, - * 2000, 2001, 2002, 2004, 2005, 2006, 2007 by Larry Wall and others + * Copyright (C) 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, + * 2002, 2004, 2005, 2006, 2007, 2008 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -43,7 +43,7 @@ #define SAVEt_I8 32 #define SAVEt_COMPPAD 33 #define SAVEt_GENERIC_PVREF 34 -#define SAVEt_PADSV 35 +#define SAVEt_PADSV_AND_MORTALIZE 35 #define SAVEt_MORTALIZESV 36 #define SAVEt_SHARED_PVREF 37 #define SAVEt_BOOL 38 @@ -55,6 +55,10 @@ #define SAVEt_STACK_CXPOS 44 #define SAVEt_PARSER 45 +#define SAVEf_SETMAGIC 1 + +#define save_helem(hv,key,sptr) save_helem_flags(hv,key,sptr,SAVEf_SETMAGIC) + #ifndef SCOPE_SAVES_SIGNAL_MASK #define SCOPE_SAVES_SIGNAL_MASK 0 #endif @@ -126,9 +130,9 @@ Closing bracket on a callback. See C and L. #define SAVESPTR(s) save_sptr((SV**)&(s)) #define SAVEPPTR(s) save_pptr((char**)&(s)) #define SAVEVPTR(s) save_vptr((void*)&(s)) -#define SAVEPADSV(s) save_padsv(s) -#define SAVEFREESV(s) save_freesv((SV*)(s)) -#define SAVEMORTALIZESV(s) save_mortalizesv((SV*)(s)) +#define SAVEPADSVANDMORTALIZE(s) save_padsv_and_mortalize(s) +#define SAVEFREESV(s) save_freesv(MUTABLE_SV(s)) +#define SAVEMORTALIZESV(s) save_mortalizesv(MUTABLE_SV(s)) #define SAVEFREEOP(o) save_freeop((OP*)(o)) #define SAVEFREEPV(p) save_freepv((char*)(p)) #define SAVECLEARSV(sv) save_clearsv((SV**)&(sv)) @@ -137,7 +141,7 @@ Closing bracket on a callback. See C and L. #define SAVESHAREDPV(s) save_shared_pvref((char**)&(s)) #define SAVESETSVFLAGS(sv,mask,val) save_set_svflags(sv,mask,val) #define SAVEDELETE(h,k,l) \ - save_delete((HV*)(h), (char*)(k), (I32)(l)) + save_delete(MUTABLE_HV(h), (char*)(k), (I32)(l)) #define SAVEDESTRUCTOR(f,p) \ save_destructor((DESTRUCTORFUNC_NOCONTEXT_t)(f), (void*)(p)) @@ -173,15 +177,15 @@ Closing bracket on a callback. See C and L. #define SAVECOMPPAD() \ STMT_START { \ SSCHECK(2); \ - SSPUSHPTR((SV*)PL_comppad); \ + SSPUSHPTR(MUTABLE_SV(PL_comppad)); \ SSPUSHINT(SAVEt_COMPPAD); \ } STMT_END #define SAVESWITCHSTACK(f,t) \ STMT_START { \ SSCHECK(3); \ - SSPUSHPTR((SV*)(f)); \ - SSPUSHPTR((SV*)(t)); \ + SSPUSHPTR(MUTABLE_SV(f)); \ + SSPUSHPTR(MUTABLE_SV(t)); \ SSPUSHINT(SAVEt_SAVESWITCHSTACK); \ SWITCHSTACK((f),(t)); \ PL_curstackinfo->si_stack = (t); \ @@ -227,15 +231,11 @@ Closing bracket on a callback. See C and L. # define SAVECOPSTASH_FREE(c) SAVESHAREDPV(CopSTASHPV(c)) # define SAVECOPFILE(c) SAVEPPTR(CopFILE(c)) # define SAVECOPFILE_FREE(c) SAVESHAREDPV(CopFILE(c)) -# define SAVECOPLABEL(c) SAVEPPTR(CopLABEL(c)) -# define SAVECOPLABEL_FREE(c) SAVESHAREDPV(CopLABEL(c)) #else # define SAVECOPSTASH(c) SAVESPTR(CopSTASH(c)) # define SAVECOPSTASH_FREE(c) SAVECOPSTASH(c) /* XXX not refcounted */ # define SAVECOPFILE(c) SAVESPTR(CopFILEGV(c)) # define SAVECOPFILE_FREE(c) SAVEGENERICSV(CopFILEGV(c)) -# define SAVECOPLABEL(c) SAVEPPTR(CopLABEL(c)) -# define SAVECOPLABEL_FREE(c) SAVEPPTR(CopLABEL(c)) #endif #define SAVECOPLINE(c) SAVEI32(CopLINE(c)) @@ -260,3 +260,12 @@ Closing bracket on a callback. See C and L. #define SSPTR(off,type) ((type) ((char*)PL_savestack + off)) #define SSPTRt(off,type) ((type*) ((char*)PL_savestack + off)) +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */