From 277e868c1c62af9319379385544f564e302be2b0 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 2 Apr 2007 19:25:53 +0000 Subject: [PATCH] The op slab allocator can call calloc() instead of malloc(), and save a Zero(). Also, argument m is unused. p4raw-id: //depot/perl@30830 --- op.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/op.c b/op.c index 49a3313..7e19f61 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. -- 1.8.3.1