cvs: php4 /main main.c
| From: | Andi Gutmans | Date: | Sun, 27 Aug 2000 19:56:22 +0000 |
| Subject: | cvs: php4 /main main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1425@lists.php.net to get a copy of this message | ||
andi Sun Aug 27 12:56:22 2000 EDT
Modified files:
/php4/main main.c
Log:
- Use do_alloca()/free_alloca() for old_cwd. This will ensure speed in
- non-ISAPI environments but in ISAPI will use emalloc()/efree() to save
- stack space. MS only gives us 10KB those bastards.
Index: php4/main/main.c
diff -u php4/main/main.c:1.301 php4/main/main.c:1.302
--- php4/main/main.c:1.301 Sun Aug 27 12:51:50 2000
+++ php4/main/main.c Sun Aug 27 12:56:22 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.301 2000/08/27 19:51:50 andi Exp $ */
+/* $Id: main.c,v 1.302 2000/08/27 19:56:22 andi Exp $ */
#include <stdio.h>
@@ -1105,10 +1105,9 @@
{
zend_file_handle *prepend_file_p, *append_file_p;
zend_file_handle prepend_file, append_file;
- char old_cwd[4096];
+ char *old_cwd;
SLS_FETCH();
- old_cwd[0] = '\0';
php_hash_environment(ELS_C SLS_CC PLS_CC);
zend_activate_modules();
@@ -1134,10 +1133,13 @@
}
}
+ old_cwd = do_alloca(4096);
+ old_cwd[0] = '\0';
if (setjmp(EG(bailout))!=0) {
if (old_cwd[0] != '\0')
V_CHDIR(old_cwd);
+ free_alloca(old_cwd);
return;
}
@@ -1173,6 +1175,7 @@
if (old_cwd[0] != '\0')
V_CHDIR(old_cwd);
+ free_alloca(old_cwd);
}
PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC)