From 14cade97ead1fce5346533c9ffae161becee82db Mon Sep 17 00:00:00 2001 From: Dave Mitchell Date: Wed, 19 May 2004 20:17:55 +0000 Subject: [perl #29637] Thread creation time is hypersensitive Due to a logic error, the dup ptr table sometimes wans't being grown, leading to extremely slow cloning. p4raw-id: //depot/perl@22830 --- sv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index f4c1cbe0a3..4be4a7fa3f 100644 --- a/sv.c +++ b/sv.c @@ -10400,11 +10400,11 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv) * hash values e.g. if they grow faster in the most significant * bits */ UV hash = PTR2UV(oldv); - bool i = 1; + bool empty = 1; assert(tbl); otblent = &tbl->tbl_ary[hash & tbl->tbl_max]; - for (tblent = *otblent; tblent; i=0, tblent = tblent->next) { + for (tblent = *otblent; tblent; empty=0, tblent = tblent->next) { if (tblent->oldval == oldv) { tblent->newval = newv; return; @@ -10416,7 +10416,7 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv) tblent->next = *otblent; *otblent = tblent; tbl->tbl_items++; - if (i && tbl->tbl_items > tbl->tbl_max) + if (!empty && tbl->tbl_items > tbl->tbl_max) ptr_table_split(tbl); } -- cgit v1.2.1