diff options
author | Andi Gutmans <andi@php.net> | 2004-07-30 21:00:37 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-07-30 21:00:37 +0000 |
commit | d7c839d54f73c6649a13bc5f2178ec5a81ce930f (patch) | |
tree | b72f7dcdafcf7c9e97c05224136ba95a5c960afe /Zend/zend_ptr_stack.c | |
parent | 138ef9a43e9320a412a40908a8733f66aa4858c7 (diff) | |
download | php-git-d7c839d54f73c6649a13bc5f2178ec5a81ce930f.tar.gz |
- More ptr_stack optimizations and cleanups
Diffstat (limited to 'Zend/zend_ptr_stack.c')
-rw-r--r-- | Zend/zend_ptr_stack.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index f1e554e10d..e15979d9fd 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -38,12 +38,8 @@ ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) va_list ptr; void *elem; - if (stack->top+count > stack->max) { /* we need to allocate more memory */ - stack->max *= 2; - stack->max += count; - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); - stack->top_element = stack->elements+stack->top; - } + ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) + va_start(ptr, count); while (count>0) { elem = va_arg(ptr, void *); |