X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=scope.h;h=fa211996e6df6caff90919bf2030101784a4ba8c;hb=9615e7416438b376811c3ef177cc7b681939bbd1;hp=69446309f2f406ca46824ae50d434f30b3ea6304;hpb=1d7c184104c076988718a01b77c8706aae05b092;p=p5sagit%2Fp5-mst-13.2.git diff --git a/scope.h b/scope.h index 6944630..fa21199 100644 --- a/scope.h +++ b/scope.h @@ -31,6 +31,7 @@ #define SAVEt_DESTRUCTOR_X 30 #define SAVEt_VPTR 31 #define SAVEt_I8 32 +#define SAVEt_COMPPAD 33 #define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow() #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i)) @@ -46,6 +47,24 @@ #define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr) #define SSPOPDXPTR (PL_savestack[--PL_savestack_ix].any_dxptr) +/* +=for apidoc Ams||SAVETMPS +Opening bracket for temporaries on a callback. See C and +L. + +=for apidoc Ams||FREETMPS +Closing bracket for temporaries on a callback. See C and +L. + +=for apidoc Ams||ENTER +Opening bracket on a callback. See C and L. + +=for apidoc Ams||LEAVE +Closing bracket on a callback. See C and L. + +=cut +*/ + #define SAVETMPS save_int((int*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix #define FREETMPS if (PL_tmps_ix > PL_tmps_floor) free_tmps() @@ -114,6 +133,19 @@ } \ } STMT_END +#define SAVECOMPPAD() \ + STMT_START { \ + if (PL_comppad && PL_curpad == AvARRAY(PL_comppad)) { \ + SSCHECK(2); \ + SSPUSHPTR((SV*)PL_comppad); \ + SSPUSHINT(SAVEt_COMPPAD); \ + } \ + else { \ + SAVEVPTR(PL_curpad); \ + SAVESPTR(PL_comppad); \ + } \ + } STMT_END + #ifdef USE_ITHREADS # define SAVECOPSTASH(cop) SAVEPPTR(CopSTASHPV(cop)) # define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop))