summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-12 12:31:29 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-12 12:31:29 +0000
commit3341f5772454aa6fd2d3ee32728b288f60620abf (patch)
treeb221f7d9fe0e2e84e126718fbd78415189a26bd2 /handy.h
parent04e62e517a756f965d577afe246e77a841330712 (diff)
downloadperl-3341f5772454aa6fd2d3ee32728b288f60620abf.tar.gz
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
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index 010cd9a622..db9e0065de 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 */