Eliminate use of $& to avoid runtime penalty
[p5sagit/p5-mst-13.2.git] / scope.h
CommitLineData
79072805 1#define SAVEt_ITEM 0
2#define SAVEt_SV 1
3#define SAVEt_AV 2
4#define SAVEt_HV 3
5#define SAVEt_INT 4
85e6fe83 6#define SAVEt_LONG 5
7#define SAVEt_I32 6
a0d0e21e 8#define SAVEt_IV 7
9#define SAVEt_SPTR 8
10#define SAVEt_APTR 9
11#define SAVEt_HPTR 10
12#define SAVEt_PPTR 11
13#define SAVEt_NSTAB 12
14#define SAVEt_SVREF 13
15#define SAVEt_GP 14
16#define SAVEt_FREESV 15
17#define SAVEt_FREEOP 16
18#define SAVEt_FREEPV 17
19#define SAVEt_CLEARSV 18
20#define SAVEt_DELETE 19
21#define SAVEt_DESTRUCTOR 20
22#define SAVEt_REGCONTEXT 21
79072805 23
24#define SSCHECK(need) if (savestack_ix + need > savestack_max) savestack_grow()
25#define SSPUSHINT(i) (savestack[savestack_ix++].any_i32 = (I32)(i))
85e6fe83 26#define SSPUSHLONG(i) (savestack[savestack_ix++].any_long = (long)(i))
a0d0e21e 27#define SSPUSHIV(i) (savestack[savestack_ix++].any_iv = (IV)(i))
79072805 28#define SSPUSHPTR(p) (savestack[savestack_ix++].any_ptr = (void*)(p))
a0d0e21e 29#define SSPUSHDPTR(p) (savestack[savestack_ix++].any_dptr = (p))
79072805 30#define SSPOPINT (savestack[--savestack_ix].any_i32)
85e6fe83 31#define SSPOPLONG (savestack[--savestack_ix].any_long)
a0d0e21e 32#define SSPOPIV (savestack[--savestack_ix].any_iv)
79072805 33#define SSPOPPTR (savestack[--savestack_ix].any_ptr)
a0d0e21e 34#define SSPOPDPTR (savestack[--savestack_ix].any_dptr)
8990e307 35
a0d0e21e 36#define SAVETMPS save_int((int*)&tmps_floor), tmps_floor = tmps_ix
37#define FREETMPS if (tmps_ix > tmps_floor) free_tmps()
38#ifdef DEPRECATED
39#define FREE_TMPS() FREETMPS
40#endif
41
42#define ENTER push_scope()
43#define LEAVE pop_scope()
8990e307 44#define LEAVE_SCOPE(old) if (savestack_ix > old) leave_scope(old)
a0d0e21e 45
46#define SAVEINT(i) save_int((int*)(&i));
47#define SAVEIV(i) save_iv((IV*)(&i));
48#define SAVEI32(i) save_I32((I32*)(&i));
49#define SAVELONG(l) save_long((long*)(&l));
50#define SAVESPTR(s) save_sptr((SV**)(&s))
51#define SAVEPPTR(s) save_pptr((char**)(&s))
52#define SAVEFREESV(s) save_freesv((SV*)(s))
53#define SAVEFREEOP(o) save_freeop((OP*)(o))
54#define SAVEFREEPV(p) save_freepv((char*)(p))
55#define SAVECLEARSV(sv) save_clearsv((SV**)(&sv))
56#define SAVEDELETE(h,k,l) save_delete((HV*)(h), (char*)(k), (I32)l)
57#define SAVEDESTRUCTOR(f,p) save_destructor(f,(void*)p)
58