From 3341f5772454aa6fd2d3ee32728b288f60620abf Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 12 Apr 2006 12:31:29 +0000 Subject: [PATCH] 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 --- handy.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 */ -- 2.7.4