summaryrefslogtreecommitdiff
path: root/Zend/zend_ptr_stack.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2004-07-30 21:00:37 +0000
committerAndi Gutmans <andi@php.net>2004-07-30 21:00:37 +0000
commitd7c839d54f73c6649a13bc5f2178ec5a81ce930f (patch)
treeb72f7dcdafcf7c9e97c05224136ba95a5c960afe /Zend/zend_ptr_stack.c
parent138ef9a43e9320a412a40908a8733f66aa4858c7 (diff)
downloadphp-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.c8
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 *);