diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-12 12:31:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-12 12:31:29 +0000 |
commit | 3341f5772454aa6fd2d3ee32728b288f60620abf (patch) | |
tree | b221f7d9fe0e2e84e126718fbd78415189a26bd2 /handy.h | |
parent | 04e62e517a756f965d577afe246e77a841330712 (diff) | |
download | perl-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.h | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 */ |