Skip to content

unpackstring() Use bytes_to_utf8_temp_pv #22946

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

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

khwilliamson
Copy link
Contributor

This will only malloc if necessary.

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

pp_pack.c Outdated
void * free_me = NULL;
s = (char *) bytes_to_utf8_free_me((U8 *) s, &len, &free_me);
if (free_me) {
SAVEFREEPV(s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this should SAVEFREEPV(free_me);

I do wonder if there should be a bytes_to_utf8_temp_pv().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bytes_to_utf8_temp_pv added and this changed to use that.

This will only malloc if necessary.
@khwilliamson khwilliamson changed the title unpackstring() Use bytes_to_utf8_free_me unpackstring() Use bytes_to_utf8_temp_pv Jan 29, 2025
@khwilliamson khwilliamson merged commit 87191dc into Perl:blead Jan 29, 2025
@khwilliamson khwilliamson deleted the pp_pack branch January 29, 2025 23:54
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