From: Nicholas Clark Date: Wed, 12 Apr 2006 12:31:29 +0000 (+0000) Subject: Newxz() can use calloc() rather than malloc(), as the implementation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3341f5772454aa6fd2d3ee32728b288f60620abf;p=p5sagit%2Fp5-mst-13.2.git Newxz() can use calloc() rather than malloc(), as the implementation of calloc() may know that it has fresh pages from the OS, and so doesn't need to zero them itself. Plus our object code should be slightly smaller. p4raw-id: //depot/perl@27774 --- diff --git a/handy.h b/handy.h index 010cd9a..db9e006 100644 --- a/handy.h +++ b/handy.h @@ -717,8 +717,7 @@ Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int li #define Newx(v,n,t) (v = (MEM_WRAP_CHECK_(n,t) MEM_LOG_ALLOC(n,t,(t*)safemalloc((MEM_SIZE)((n)*sizeof(t)))))) #define Newxc(v,n,t,c) (v = (MEM_WRAP_CHECK_(n,t) MEM_LOG_ALLOC(n,t,(c*)safemalloc((MEM_SIZE)((n)*sizeof(t)))))) -#define Newxz(v,n,t) (v = (MEM_WRAP_CHECK_(n,t) MEM_LOG_ALLOC(n,t,(t*)safemalloc((MEM_SIZE)((n)*sizeof(t)))))), \ - memzero((char*)(v), (n)*sizeof(t)) +#define Newxz(v,n,t) (v = (MEM_WRAP_CHECK_(n,t) MEM_LOG_ALLOC(n,t,(t*)safecalloc((n),sizeof(t))))) #ifndef PERL_CORE /* pre 5.9.x compatibility */