]> granicus.if.org Git - php/commitdiff
zend_stack initialization is delayed before the actual usage
authorDmitry Stogov <dmitry@php.net>
Tue, 6 Jul 2010 16:09:43 +0000 (16:09 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 6 Jul 2010 16:09:43 +0000 (16:09 +0000)
NEWS
Zend/zend_stack.c

diff --git a/NEWS b/NEWS
index da0fe6290ba96341b7352562ec8ec6159cd9b4e5..06989d3cd69e32dc9371694a8e72adfc5cd61e4f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ PHP                                                                        NEWS
     A constant class name may be used as a direct operand of ZEND_FETCH_*
     instruction without previous ZEND_FETCH_CLASS.
   . eliminated unnecessary iterations during request startup/shutdown
+  . zend_stack initialization is delayed before the actual usage
 - Added concept of interned strings. All strings constants known at compile
   time are allocated in a single copy and never changed. (Dmitry)
 - Added an optimization which saves memory and emalloc/efree calls for empty
index 266faae362cd73cde7ec3c32a4c9056ec3ac6864..1c6b066507c5624d1cc9ae6e683113a1d05dc3f3 100644 (file)
 ZEND_API int zend_stack_init(zend_stack *stack)
 {
        stack->top = 0;
-       stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE);
-       if (!stack->elements) {
-               return FAILURE;
-       } else {
-               stack->max = STACK_BLOCK_SIZE;
-               return SUCCESS;
-       }
+       stack->max = 0;
+       stack->elements = NULL;
+       return SUCCESS;
 }
 
 ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size)