version 1.1, 2012/02/21 23:47:52
|
version 1.1.1.4, 2014/06/15 20:04:04
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Zend Engine | |
| Zend Engine | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | | | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 2.00 of the Zend license, | |
| This source file is subject to version 2.00 of the Zend license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 25
|
Line 25
|
ZEND_API int zend_stack_init(zend_stack *stack) |
ZEND_API int zend_stack_init(zend_stack *stack) |
{ |
{ |
stack->top = 0; |
stack->top = 0; |
stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); | stack->max = 0; |
if (!stack->elements) { | stack->elements = NULL; |
return FAILURE; | return SUCCESS; |
} else { | |
stack->max = STACK_BLOCK_SIZE; | |
return SUCCESS; | |
} | |
} |
} |
|
|
ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size) |
ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size) |
Line 100 ZEND_API int zend_stack_destroy(zend_stack *stack)
|
Line 96 ZEND_API int zend_stack_destroy(zend_stack *stack)
|
for (i = 0; i < stack->top; i++) { |
for (i = 0; i < stack->top; i++) { |
efree(stack->elements[i]); |
efree(stack->elements[i]); |
} |
} |
|
|
efree(stack->elements); |
efree(stack->elements); |
|
stack->elements = NULL; |
} |
} |
|
|
return SUCCESS; |
return SUCCESS; |