Re: PHP 4.0 Bug #2004: recursive call limitation
| From: | Andi Gutmans | Date: | Tue, 10 Aug 1999 17:00:12 +0000 |
| Subject: | Re: PHP 4.0 Bug #2004: recursive call limitation | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-9724@lists.php.net to get a copy of this message | ||
At 09:13 AM 8/10/99 +0000, gregori wrote:
That's a weird question ... the deepest nesting level should be set by the machine (memory + swap memory) and not by the software ?! As far as I remember my computer science lesson we could have :Well you were maybe a good theoretical student but not a good practical student. In just about any OS the stack doesn't really grow until it meets the heap. Usually you have around 4 gig's of virtual heap but the stack is limited to much much less than that. It can usually only grow like 10-20MB, often even much less. Don't believe everything your lecture tells you. For example, login to a UNIX account and run the limit command. You'll see a nice stack limit.
--------------------Bullshit. ASP has a similar limited and it's a computer language. If you need to run scripts that have 1 million nesting level than you shouldn't be using a scripting language and you should be using C, Fortran, or C++.| Stack | | | | | \ / | | | | | | | | / \ | | | | | heap ||------------------| Anyway, maybe you have done something different to speed function calls. I think we need at least a level of one million, if we want to be safe ... but, if we keep a limit of 8192, PHP will never have the name of language.
Maybe I'm wrong ... maybe I'm the only one who scare about that ... but a compile-time switch will be more than a good news ... and a level of 1 million will be safe.After all I said, it can be improved, for example, in zend_execute.c you can change on line 860+ the do_alloca and free_alloca macro's to use emalloc and efree. However, it'll slow things down a bit. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/