Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86143 invoked from network); 30 Apr 2008 10:50:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 10:50:51 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.151.69.1 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.151.69.1 liberty.vosn.net Linux 2.4/2.6 Received: from [209.151.69.1] ([209.151.69.1:60445] helo=liberty.vosn.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/22-05418-A0F48184 for ; Wed, 30 Apr 2008 06:50:50 -0400 Received: from 75-121-104-210.dyn.centurytel.net ([75.121.104.210]:58536 helo=pc1) by liberty.vosn.net with smtp (Exim 4.68) (envelope-from ) id 1Jr9te-0007Rm-U0; Wed, 30 Apr 2008 04:50:47 -0600 Message-ID: <00cf01c8aab0$0be2fb50$0201a8c0@pc1> To: "Dmitry Stogov" Cc: , "Andi Gutmans" References: <014b01c8a6db$57d53ba0$0201a8c0@pc1> <48181C02.3050705@zend.com> <00a701c8aaa9$e0fcd4c0$0201a8c0@pc1> <48184609.5000804@zend.com> Date: Wed, 30 Apr 2008 05:50:44 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - liberty.vosn.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - realplain.com Subject: Re: [PHP-DEV] [PATCH] More array filling optimizations From: php_lists@realplain.com ("Matt Wilmas") Hi again Dmitry, Hmm, if a -1 size was passed, I thought it would just make a huge array size (bad, obviously), but the tests would still work. (Or I guess it might exhaust memory_limit.) Anyway, the code for checking the size (length variable) in array_splice() is copied from php_splice(), so maybe there's some other error if it's becoming -1... You don't think it makes sense to check return_value_used like next/prev/end/reset do? They would only create a 1 element array, but array_splice() could waste time filling a large array that isn't used. I think the function is used a lot to only remove/replace elements, not using the return_value: http://www.google.com/codesearch?q=lang%3Aphp+array_splice If there's a -1 size bug, the array_splice changes can be reverted and simply have: if (return_value_used) { /* Initialize return value */ array_init(return_value); rem_hash = &Z_ARRVAL_P(return_value); } - Matt ----- Original Message ----- From: "Dmitry Stogov" Sent: Wednesday, April 30, 2008 > For some reason "make test" with the patch reported several broken > array_splice() tests. Looking in gdb I saw that init_array() got -1 as a > size of new array. > > I don't think checks for return_value_used for array_splice() have a lot > of sense. > > Thanks. Dmitry.