In Perl_ptr_table_new(), fight back against the cult of Newxz().
Nicholas Clark [Mon, 18 May 2009 12:08:36 +0000 (13:08 +0100)]
(There's no need to zero-allocate memory for a structure when you're about to
explicitly allocate every member.)

sv.c

diff --git a/sv.c b/sv.c
index 6212955..dd51f9f 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10578,7 +10578,7 @@ Perl_ptr_table_new(pTHX)
     PTR_TBL_t *tbl;
     PERL_UNUSED_CONTEXT;
 
-    Newxz(tbl, 1, PTR_TBL_t);
+    Newx(tbl, 1, PTR_TBL_t);
     tbl->tbl_max       = 511;
     tbl->tbl_items     = 0;
     Newxz(tbl->tbl_ary, tbl->tbl_max + 1, PTR_TBL_ENT_t*);