diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-06 18:07:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-06 18:07:28 +0000 |
commit | 2053acbf3eca3963d3a31404e10d54b0900f80ed (patch) | |
tree | 88e8d79a0fa09205a2981f5021cb3636b1949b0f /mathoms.c | |
parent | b7f7fff6135b3e12b22a70128bcf11fae57a5d95 (diff) | |
download | perl-2053acbf3eca3963d3a31404e10d54b0900f80ed.tar.gz |
Move Perl_save_long, Perl_save_I16, Perl_save_I8, Perl_save_iv,
Perl_save_nogv, Perl_save_list, Perl_save_destructor to mathoms.c
Perl_save_svref can't actually move because it calls a static function.
p4raw-id: //depot/perl@27106
Diffstat (limited to 'mathoms.c')
-rw-r--r-- | mathoms.c | 75 |
1 files changed, 75 insertions, 0 deletions
@@ -1088,6 +1088,81 @@ Perl_sv_nounlocking(pTHX_ SV *sv) PERL_UNUSED_ARG(sv); } +void +Perl_save_long(pTHX_ long int *longp) +{ + dVAR; + SSCHECK(3); + SSPUSHLONG(*longp); + SSPUSHPTR(longp); + SSPUSHINT(SAVEt_LONG); +} + +void +Perl_save_I16(pTHX_ I16 *intp) +{ + dVAR; + SSCHECK(3); + SSPUSHINT(*intp); + SSPUSHPTR(intp); + SSPUSHINT(SAVEt_I16); +} + +void +Perl_save_I8(pTHX_ I8 *bytep) +{ + dVAR; + SSCHECK(3); + SSPUSHINT(*bytep); + SSPUSHPTR(bytep); + SSPUSHINT(SAVEt_I8); +} + +void +Perl_save_iv(pTHX_ IV *ivp) +{ + dVAR; + SSCHECK(3); + SSPUSHIV(*ivp); + SSPUSHPTR(ivp); + SSPUSHINT(SAVEt_IV); +} + +void +Perl_save_nogv(pTHX_ GV *gv) +{ + dVAR; + SSCHECK(2); + SSPUSHPTR(gv); + SSPUSHINT(SAVEt_NSTAB); +} + +void +Perl_save_list(pTHX_ register SV **sarg, I32 maxsarg) +{ + dVAR; + register I32 i; + + for (i = 1; i <= maxsarg; i++) { + register SV * const sv = newSV(0); + sv_setsv(sv,sarg[i]); + SSCHECK(3); + SSPUSHPTR(sarg[i]); /* remember the pointer */ + SSPUSHPTR(sv); /* remember the value */ + SSPUSHINT(SAVEt_ITEM); + } +} + +void +Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p) +{ + dVAR; + SSCHECK(3); + SSPUSHDPTR(f); + SSPUSHPTR(p); + SSPUSHINT(SAVEt_DESTRUCTOR); +} + #endif /* NO_MATHOMS */ /* |