diff options
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | Zend/zend_stack.c | 10 |
2 files changed, 4 insertions, 7 deletions
@@ -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 diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c index 266faae362..1c6b066507 100644 --- a/Zend/zend_stack.c +++ b/Zend/zend_stack.c @@ -25,13 +25,9 @@ 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) |
