Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sv_clear: with zero SvREFCNT, call sv_free2, not sv_free #22843

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

richardleach
Copy link
Contributor

Towards the bottom of Perl_sv_clear, there is a region described as being * unrolled SvREFCNT_dec and sv_free2 follows: */. This was originally accurate when introduced in 5239d5c but the definitions of Perl_sv_free, Perl_sv_free2, and SvREFCNT_dec were updated in 75a9bf9 and this region of code didn't get updated to match.

I'm unsure of how to best refactor this code region, but right now the call to sv_free(sv) ultimately boils down to a call to sv_free2, so this commit just goes there directly.


  • This set of changes does not require a perldelta entry.

Towards the bottom of `Perl_sv_clear`, there is a region described as
being `* unrolled SvREFCNT_dec and sv_free2 follows: */`. This was
introduced in Perl@5239d5c
but the definitions of `Perl_sv_free`, `Perl_sv_free2`, and `SvREFCNT_dec`
were updated in Perl@75a9bf9
and this region of code didn't get updated.

The unrolling remains valid, but the call to `sv_free(sv)` ultimately boils
down to a call to `sv_free2`, so this commit just goes there directly.
@richardleach richardleach force-pushed the hydahy/sv_clear-free-free2 branch from 4bc1619 to bb59fb2 Compare December 7, 2024 23:28
@richardleach richardleach merged commit c38b052 into Perl:blead Dec 12, 2024
33 checks passed
@richardleach richardleach deleted the hydahy/sv_clear-free-free2 branch December 12, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Perl_sv_clear: unrolled SvREFCNT_dec and sv_free2....isn't that?!
2 participants