summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-03-02 15:31:59 +0100
committerKarl Williamson <khw@cpan.org>2022-03-02 08:25:18 -0700
commitba2557cc22570b32dcdc36c5ffd056559d5a4110 (patch)
tree26cdf003be0b3a27a97810f0748ff1553cddada6 /perl.c
parentfbb9d44aca632b09ec1e12d53fdd2aedb72e78b2 (diff)
downloadperl-ba2557cc22570b32dcdc36c5ffd056559d5a4110.tar.gz
perl.c: zero stacks on creation
I think not initializing these to zero is a false economy, Felipe Gasper brought this up that it made debugging issues with the stack confusing. We only do this once per process and zeroing memory is prety cheap so it make sense to me to zero the stacks on startup.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/perl.c b/perl.c
index 528fd2ab57..ae02a35aa5 100644
--- a/perl.c
+++ b/perl.c
@@ -4341,26 +4341,26 @@ Perl_init_stacks(pTHX)
PL_stack_sp = PL_stack_base;
PL_stack_max = PL_stack_base + AvMAX(PL_curstack);
- Newx(PL_tmps_stack,REASONABLE(128),SV*);
+ Newxz(PL_tmps_stack,REASONABLE(128),SV*);
PL_tmps_floor = -1;
PL_tmps_ix = -1;
PL_tmps_max = REASONABLE(128);
- Newx(PL_markstack,REASONABLE(32),I32);
+ Newxz(PL_markstack,REASONABLE(32),I32);
PL_markstack_ptr = PL_markstack;
PL_markstack_max = PL_markstack + REASONABLE(32);
SET_MARK_OFFSET;
- Newx(PL_scopestack,REASONABLE(32),I32);
+ Newxz(PL_scopestack,REASONABLE(32),I32);
#ifdef DEBUGGING
- Newx(PL_scopestack_name,REASONABLE(32),const char*);
+ Newxz(PL_scopestack_name,REASONABLE(32),const char*);
#endif
PL_scopestack_ix = 0;
PL_scopestack_max = REASONABLE(32);
size = REASONABLE_but_at_least(128,SS_MAXPUSH);
- Newx(PL_savestack, size, ANY);
+ Newxz(PL_savestack, size, ANY);
PL_savestack_ix = 0;
/*PL_savestack_max lies: it always has SS_MAXPUSH more than it claims */
PL_savestack_max = size - SS_MAXPUSH;