summaryrefslogtreecommitdiff
path: root/Zend/zend_ptr_stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_ptr_stack.h')
-rw-r--r--Zend/zend_ptr_stack.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h
index affe7d037b..8f2828d54a 100644
--- a/Zend/zend_ptr_stack.h
+++ b/Zend/zend_ptr_stack.h
@@ -46,8 +46,9 @@ END_EXTERN_C()
#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \
if (stack->top+count > stack->max) { \
/* we need to allocate more memory */ \
- stack->max *= 2; \
- stack->max += count; \
+ do { \
+ stack->max += PTR_STACK_BLOCK_SIZE; \
+ } while (stack->top+count > stack->max); \
stack->elements = (void **) perealloc(stack->elements, (sizeof(void *) * (stack->max)), stack->persistent); \
stack->top_element = stack->elements+stack->top; \
}