As a side note, I think the following code could be optimized:

Probably it could, but note that the code not just moves the stack pointer, but also destroys arguments there (zval_ptr_dtor).

+ while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
+ zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
+ zval_ptr_dtor(&stack_zval_p);
 }

I think you can simply discard the last n ptrs on the stack. A zend_vm_stack_pop(num_elements) would do the trick (or a zend_vm_stack_pop_until(stack_frame)). That way the function call cleanup would be a little faster.

May be I misunderstood you. Lets commit unmodified patch and then you'll show me a way to optimize it.

Uhm ok. Maybe I overlooked the issue. Please commit the patch and I'll review it again.

Thanks,
Nuno
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to