From: Nicholas Clark Date: Mon, 18 May 2009 12:08:36 +0000 (+0100) Subject: In Perl_ptr_table_new(), fight back against the cult of Newxz(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3a120bf72d91507f4a2782bf0be31aa8b4dba31;p=p5sagit%2Fp5-mst-13.2.git In Perl_ptr_table_new(), fight back against the cult of Newxz(). (There's no need to zero-allocate memory for a structure when you're about to explicitly allocate every member.) --- diff --git a/sv.c b/sv.c index 6212955..dd51f9f 100644 --- 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*);