diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-02 19:25:53 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-02 19:25:53 +0000 |
commit | 277e868c1c62af9319379385544f564e302be2b0 (patch) | |
tree | 5c90c1dbff45e4e16120cf7d3b8dccae952488f7 /op.c | |
parent | f1fac472816f68ec1eac2f84892d78b65a4598fb (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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. |