summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-09-20 15:04:29 +0000
committerNicholas Clark <nick@ccl4.org>2021-09-28 06:12:27 +0000
commit40385047d97eb13626cd69471b811bd8e751f665 (patch)
tree6a3cdb7088a03846beb1e1df3b47469e90349d22 /perl.c
parent53e57886af4cddfdf74c6a06e9a6995d07318806 (diff)
downloadperl-40385047d97eb13626cd69471b811bd8e751f665.tar.gz
perl_alloc_using() should use ->pCalloc
Use ->pCalloc instead of ->pMalloc followed by Zero() This commit is analogous to the change in perl_alloc() in the previous commit - the order of S_init_tls_and_interp() and Zero() can be swapped, at which point the change to use "calloc" is obvious.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index c9807b7226..8beb5d0622 100644
--- a/perl.c
+++ b/perl.c
@@ -159,9 +159,8 @@ perl_alloc_using(struct IPerlMem* ipM, struct IPerlMem* ipMS,
PERL_ARGS_ASSERT_PERL_ALLOC_USING;
/* Newx() needs interpreter, so call malloc() instead */
- my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+ my_perl = (PerlInterpreter*)(*ipM->pCalloc)(ipM, 1, sizeof(PerlInterpreter));
S_init_tls_and_interp(my_perl);
- Zero(my_perl, 1, PerlInterpreter);
PL_Mem = ipM;
PL_MemShared = ipMS;
PL_MemParse = ipMP;