From: Nicholas Clark Date: Mon, 1 Dec 2008 00:02:17 +0000 (+0000) Subject: Expose save_pushptrptr() and implement SAVESWITCHSTACK() with it. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dfcd3de5defffbf214d60b8322b79ded8e367fd3;hp=1409bc0658469580630ba458c85fe9cc3cb2d78c;p=p5sagit%2Fp5-mst-13.2.git Expose save_pushptrptr() and implement SAVESWITCHSTACK() with it. p4raw-id: //depot/perl@34960 --- diff --git a/embed.fnc b/embed.fnc index e205c90..6874bc4 100644 --- a/embed.fnc +++ b/embed.fnc @@ -925,9 +925,10 @@ Ap |SV* |save_svref |NN SV** sptr Ap |void |save_pushptr |NULLOK void *const ptr|const int type #if defined(PERL_IN_SCOPE_C) s |void |save_pushi32ptr|I32 i|NULLOK void *const ptr|const int type -s |void |save_pushptrptr|NULLOK void *const ptr1 \ - |NULLOK void *const ptr2|const int type #endif +: Used by SAVESWITCHSTACK() in pp.c +p |void |save_pushptrptr|NULLOK void *const ptr1 \ + |NULLOK void *const ptr2|const int type : Used in perly.y p |OP* |sawparens |NULLOK OP* o : Used in perly.y diff --git a/embed.h b/embed.h index 9320030..397e2f4 100644 --- a/embed.h +++ b/embed.h @@ -809,10 +809,10 @@ #if defined(PERL_IN_SCOPE_C) #ifdef PERL_CORE #define save_pushi32ptr S_save_pushi32ptr -#define save_pushptrptr S_save_pushptrptr #endif #endif #ifdef PERL_CORE +#define save_pushptrptr Perl_save_pushptrptr #define sawparens Perl_sawparens #define scalar Perl_scalar #endif @@ -3159,10 +3159,10 @@ #if defined(PERL_IN_SCOPE_C) #ifdef PERL_CORE #define save_pushi32ptr(a,b,c) S_save_pushi32ptr(aTHX_ a,b,c) -#define save_pushptrptr(a,b,c) S_save_pushptrptr(aTHX_ a,b,c) #endif #endif #ifdef PERL_CORE +#define save_pushptrptr(a,b,c) Perl_save_pushptrptr(aTHX_ a,b,c) #define sawparens(a) Perl_sawparens(aTHX_ a) #define scalar(a) Perl_scalar(aTHX_ a) #endif diff --git a/proto.h b/proto.h index 869bd0a..83455f3 100644 --- a/proto.h +++ b/proto.h @@ -2915,8 +2915,8 @@ PERL_CALLCONV SV* Perl_save_svref(pTHX_ SV** sptr) PERL_CALLCONV void Perl_save_pushptr(pTHX_ void *const ptr, const int type); #if defined(PERL_IN_SCOPE_C) STATIC void S_save_pushi32ptr(pTHX_ I32 i, void *const ptr, const int type); -STATIC void S_save_pushptrptr(pTHX_ void *const ptr1, void *const ptr2, const int type); #endif +PERL_CALLCONV void Perl_save_pushptrptr(pTHX_ void *const ptr1, void *const ptr2, const int type); PERL_CALLCONV OP* Perl_sawparens(pTHX_ OP* o); PERL_CALLCONV OP* Perl_scalar(pTHX_ OP* o); #if defined(PERL_IN_OP_C) diff --git a/scope.c b/scope.c index ab2d1ff..90b6c40 100644 --- a/scope.c +++ b/scope.c @@ -184,8 +184,8 @@ S_save_scalar_at(pTHX_ SV **sptr, const U32 flags) return sv; } -static void -S_save_pushptrptr(pTHX_ void *const ptr1, void *const ptr2, const int type) +void +Perl_save_pushptrptr(pTHX_ void *const ptr1, void *const ptr2, const int type) { dVAR; SSCHECK(3); diff --git a/scope.h b/scope.h index 6eddb19..fc639af 100644 --- a/scope.h +++ b/scope.h @@ -178,10 +178,7 @@ Closing bracket on a callback. See C and L. #define SAVESWITCHSTACK(f,t) \ STMT_START { \ - SSCHECK(3); \ - SSPUSHPTR(MUTABLE_SV(f)); \ - SSPUSHPTR(MUTABLE_SV(t)); \ - SSPUSHINT(SAVEt_SAVESWITCHSTACK); \ + save_pushptrptr(MUTABLE_SV(f), MUTABLE_SV(t), SAVEt_SAVESWITCHSTACK); \ SWITCHSTACK((f),(t)); \ PL_curstackinfo->si_stack = (t); \ } STMT_END