diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-09-20 15:04:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-09-28 06:12:27 +0000 |
commit | 40385047d97eb13626cd69471b811bd8e751f665 (patch) | |
tree | 6a3cdb7088a03846beb1e1df3b47469e90349d22 /perl.c | |
parent | 53e57886af4cddfdf74c6a06e9a6995d07318806 (diff) | |
download | perl-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; |