-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pp_aassign: optimise AV branch under PERL_RC_STACK
The block of code that handles (..., @A) = (...); used to temporarily store on the temps stack, pointers to all the RH elements, in order to avoid things being prematurely freed, such as in @A = ($a[0], ...). Under PERL_RC_STACK builds this is no longer necessary, so simplify the code. All changes are wrapped in '#ifdef PERL_RC_STACK' etc. Aliasing needs special handling. When in list context, we return refs to SVs, but store the SVs themselves in the AV. In the traditional approach, the stack keeps the RVs while the temps stack has the SvRV() values - this makes it easy to block copy the SVs to the array while leaving the stack untouched. When the temps stack is no longer being used, we have to manually dereference each RV as we assign values to the stack. Do this using the slow av_store() loop rather than the optimised Copy(AvARRAY(),...) branch.
- Loading branch information
Showing
1 changed file
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters