Re: Segmented argument_stack

From: Date: Wed, 23 Jan 2008 17:42:27 +0000
Subject: Re: Segmented argument_stack
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-34887@lists.php.net to get a copy of this message
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

« previous php.internals (#34887) next »