Re: Bug #13587 Updated: Recurence makes crash
| From: | Jeroen van Wolffelaar | Date: | Sun, 07 Oct 2001 23:10:40 +0000 |
| Subject: | Re: Bug #13587 Updated: Recurence makes crash | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67509@lists.php.net to get a copy of this message | ||
On Sun, 7 Oct 2001, Jeroen van Wolffelaar wrote:
> On Sun, 7 Oct 2001, Jeroen van Wolffelaar wrote:
>
> > <snip>
>
> Just curious: Why has there been chosen for resizeble array
> implementation and not a linked list?
Stupid question, linked list is theoretically smaller, but when used as
execution stack a resizeble array is of course faster, provided the
stack remains small.
A good combination could be a fixed-size stack with linked list for
the deeper portion of the stack in cases with deep execution stacks
(nearly always recursion). This can be
improved by have a kind of chunked linked list (allocate an array for a
few dozen of places each time on stack overflow, and also dealloc those
arrays when not needed anymore.) Nowadays, when you run one time a
script with a lot of recursion, the memory for the stack is never given
back.
Jeroen van Wolffelaar
Jeroen@A-Eskwadraat.nl
http://www.A-Eskwadraat.nl/~jeroen