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

do_print: Use new utf8_to_bytes_temp_pv() #22812

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

khwilliamson
Copy link
Contributor

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

@khwilliamson khwilliamson changed the title do_print: Use new utfj8_to_bytes_temp_pv() do_print: Use new utf8_to_bytes_temp_pv() Dec 3, 2024
doio.c Show resolved Hide resolved
doio.c Outdated Show resolved Hide resolved
embed.fnc Outdated Show resolved Hide resolved
doio.c Outdated Show resolved Hide resolved
doio.c Outdated Show resolved Hide resolved
doio.c Outdated Show resolved Hide resolved
khwilliamson added a commit to khwilliamson/perl5 that referenced this pull request Jan 12, 2025
Two new functions were recently added that have a *free_me parameter.
As Tony Cook pointed out in Perl#22812, these would better have been void*
instead of U8*.  This commit changes to use void*

One function in pp.c was using this parameter as a U8* and using its
contents.  But this need goes away with the new bytes_to_utf8_free_me()
function, which eliminates the kludge pp.c used to make sure the new
memory got freed.
khwilliamson added a commit to khwilliamson/perl5 that referenced this pull request Jan 21, 2025
Two new functions were recently added that have a *free_me parameter.
As Tony Cook pointed out in Perl#22812, these would better have been void*
instead of U8*.  This commit changes to use void*

One function in pp.c was using this parameter as a U8* and using its
contents.  But this need goes away with the new bytes_to_utf8_free_me()
function, which eliminates the kludge pp.c used to make sure the new
memory got freed.
This removes 6 casts and adds 1, resulting in cleaner looking code.
These new functions do the work this used to duplicate, except they
allocate memory only if necessary, instead of always, as previously
@khwilliamson khwilliamson merged commit 34e58a7 into Perl:blead Jan 28, 2025
33 checks passed
@khwilliamson khwilliamson deleted the do_io branch January 28, 2025 05:29
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.

2 participants