summaryrefslogtreecommitdiff
path: root/Zend/zend_ptr_stack.h
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-11-09 10:34:27 +0000
committerJohannes Schlüter <johannes@php.net>2007-11-09 10:34:27 +0000
commite6dff0caa47efee905207d4a2b2df9f24ae717d9 (patch)
tree033512a063f4ab90f32420e9f5e5f66ed4c9c9cb /Zend/zend_ptr_stack.h
parent7ab56f7a434199413299096d7227aa7508f07103 (diff)
downloadphp-git-e6dff0caa47efee905207d4a2b2df9f24ae717d9.tar.gz
- MFH: Allow persistent zent_ptr_stacks (patch by Andrey Hristov)
Diffstat (limited to 'Zend/zend_ptr_stack.h')
-rw-r--r--Zend/zend_ptr_stack.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h
index ff308119a7..187e03dd05 100644
--- a/Zend/zend_ptr_stack.h
+++ b/Zend/zend_ptr_stack.h
@@ -26,6 +26,7 @@ typedef struct _zend_ptr_stack {
int top, max;
void **elements;
void **top_element;
+ zend_bool persistent;
} zend_ptr_stack;
@@ -33,6 +34,7 @@ typedef struct _zend_ptr_stack {
BEGIN_EXTERN_C()
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
+ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent);
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
@@ -46,7 +48,7 @@ END_EXTERN_C()
/* we need to allocate more memory */ \
stack->max *= 2; \
stack->max += count; \
- stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); \
+ stack->elements = (void **) perealloc(stack->elements, (sizeof(void *) * (stack->max)), stack->persistent); \
stack->top_element = stack->elements+stack->top; \
}