summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-02 19:25:53 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-02 19:25:53 +0000
commit277e868c1c62af9319379385544f564e302be2b0 (patch)
tree5c90c1dbff45e4e16120cf7d3b8dccae952488f7 /op.c
parentf1fac472816f68ec1eac2f84892d78b65a4598fb (diff)
downloadperl-277e868c1c62af9319379385544f564e302be2b0.tar.gz
The op slab allocator can call calloc() instead of malloc(), and save
a Zero(). Also, argument m is unused. p4raw-id: //depot/perl@30830
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/op.c b/op.c
index 49a3313bd4..7e19f6126e 100644
--- a/op.c
+++ b/op.c
@@ -116,6 +116,7 @@ recursive, but it's recursive on basic blocks, not on tree nodes.
void *
Perl_Slab_Alloc(pTHX_ int m, size_t sz)
{
+ PERL_UNUSED_ARG(m);
/*
* To make incrementing use count easy PL_OpSlab is an I32 *
* To make inserting the link to slab PL_OpPtr is I32 **
@@ -138,12 +139,12 @@ Perl_Slab_Alloc(pTHX_ int m, size_t sz)
abort();
}
#else
- PL_OpPtr = (I32 **) PerlMemShared_malloc(PERL_SLAB_SIZE*sizeof(I32*));
+
+ PL_OpPtr = (I32 **) PerlMemShared_calloc(PERL_SLAB_SIZE,sizeof(I32*));
#endif
if (!PL_OpPtr) {
return NULL;
}
- Zero(PL_OpPtr,PERL_SLAB_SIZE,I32 **);
/* We reserve the 0'th I32 sized chunk as a use count */
PL_OpSlab = (I32 *) PL_OpPtr;
/* Reduce size by the use count word, and by the size we need.