#define swash_init Perl_swash_init
#define taint_env Perl_taint_env
#define taint_proper Perl_taint_proper
+#define tmps_grow Perl_tmps_grow
#define to_uni_lower Perl_to_uni_lower
#define to_uni_lower_lc Perl_to_uni_lower_lc
#define to_uni_title Perl_to_uni_title
#define sv_len_utf8 CPerlObj::Perl_sv_len_utf8
#define sv_magic CPerlObj::Perl_sv_magic
#define sv_mortalcopy CPerlObj::Perl_sv_mortalcopy
-#define sv_mortalgrow CPerlObj::Perl_sv_mortalgrow
#define sv_ncmp CPerlObj::Perl_sv_ncmp
#define sv_newmortal CPerlObj::Perl_sv_newmortal
#define sv_newref CPerlObj::Perl_sv_newref
#define swash_init CPerlObj::Perl_swash_init
#define taint_env CPerlObj::Perl_taint_env
#define taint_proper CPerlObj::Perl_taint_proper
+#define tmps_grow CPerlObj::Perl_tmps_grow
#define to_uni_lower CPerlObj::Perl_to_uni_lower
#define to_uni_lower_lc CPerlObj::Perl_to_uni_lower_lc
#define to_uni_title CPerlObj::Perl_to_uni_title
del_xnv
del_xpv
del_xrv
- sv_mortalgrow
sv_unglob
avhv_index_sv
do_report_used
swash_init
taint_env
taint_proper
+tmps_grow
to_uni_lower
to_uni_lower_lc
to_uni_title
#define sv_magic pPerl->Perl_sv_magic
#undef sv_mortalcopy
#define sv_mortalcopy pPerl->Perl_sv_mortalcopy
-#undef sv_mortalgrow
-#define sv_mortalgrow pPerl->Perl_sv_mortalgrow
#undef sv_ncmp
#define sv_ncmp pPerl->Perl_sv_ncmp
#undef sv_newmortal
#define taint_env pPerl->Perl_taint_env
#undef taint_proper
#define taint_proper pPerl->Perl_taint_proper
+#undef tmps_grow
+#define tmps_grow pPerl->Perl_tmps_grow
#undef to_uni_lower
#define to_uni_lower pPerl->Perl_to_uni_lower
#undef to_uni_lower_lc
#define SWITCHSTACK(f,t) \
STMT_START { \
- AvFILLp(f) = sp - PL_stack_base; \
+ AvFILLp(f) = sp - PL_stack_base; \
PL_stack_base = AvARRAY(t); \
- PL_stack_max = PL_stack_base + AvMAX(t); \
+ PL_stack_max = PL_stack_base + AvMAX(t); \
sp = PL_stack_sp = PL_stack_base + AvFILLp(t); \
- PL_curstack = t; \
+ PL_curstack = t; \
} STMT_END
#define EXTEND_MORTAL(n) \
- STMT_START { \
- if (PL_tmps_ix + (n) >= PL_tmps_max) \
- Renew(PL_tmps_stack, PL_tmps_max = PL_tmps_ix + (n) + 1, SV*); \
- } STMT_END
+ STMT_START { \
+ if (PL_tmps_ix + (n) >= PL_tmps_max) \
+ tmps_grow(n); \
+ } STMT_END
#define AMGf_noright 1
#define AMGf_noleft 2
void del_xnv _((XPVNV* p));
void del_xpv _((XPV* p));
void del_xrv _((XRV* p));
-void sv_mortalgrow _((void));
void sv_unglob _((SV* sv));
I32 avhv_index_sv _((SV* sv));
VIRTUAL char* sv_2pv_nolen _((SV* sv));
VIRTUAL char* sv_pv _((SV *sv));
VIRTUAL void sv_force_normal _((SV *sv));
+VIRTUAL void tmps_grow _((I32 n));
+
#undef GROW
void
+tmps_grow(I32 n)
+{
+ dTHR;
+#ifndef STRESS_REALLOC
+ if (n < 128)
+ n = (PL_tmps_max < 512) ? 128 : 512;
+#endif
+ PL_tmps_max = PL_tmps_ix + n + 1;
+ Renew(PL_tmps_stack, PL_tmps_max, SV*);
+}
+
+
+void
free_tmps(void)
{
dTHR;
static void del_xnv _((XPVNV* p));
static void del_xpv _((XPV* p));
static void del_xrv _((XRV* p));
-static void sv_mortalgrow _((void));
static void sv_unglob _((SV* sv));
#ifndef PURIFY
* hopefully we won't free it until it has been assigned to a
* permanent location. */
-STATIC void
-sv_mortalgrow(void)
-{
- dTHR;
- PL_tmps_max += (PL_tmps_max < 512) ? 128 : 512;
- Renew(PL_tmps_stack, PL_tmps_max, SV*);
-}
-
SV *
sv_mortalcopy(SV *oldstr)
{
SvREFCNT(sv) = 1;
SvFLAGS(sv) = 0;
sv_setsv(sv,oldstr);
- if (++PL_tmps_ix >= PL_tmps_max)
- sv_mortalgrow();
- PL_tmps_stack[PL_tmps_ix] = sv;
+ EXTEND_MORTAL(1);
+ PL_tmps_stack[++PL_tmps_ix] = sv;
SvTEMP_on(sv);
return sv;
}
SvANY(sv) = 0;
SvREFCNT(sv) = 1;
SvFLAGS(sv) = SVs_TEMP;
- if (++PL_tmps_ix >= PL_tmps_max)
- sv_mortalgrow();
- PL_tmps_stack[PL_tmps_ix] = sv;
+ EXTEND_MORTAL(1);
+ PL_tmps_stack[++PL_tmps_ix] = sv;
return sv;
}
return sv;
if (SvREADONLY(sv) && SvIMMORTAL(sv))
return sv;
- if (++PL_tmps_ix >= PL_tmps_max)
- sv_mortalgrow();
- PL_tmps_stack[PL_tmps_ix] = sv;
+ EXTEND_MORTAL(1);
+ PL_tmps_stack[++PL_tmps_ix] = sv;
SvTEMP_on(sv);
return sv;
}