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

Memory management for Datum to String conversion #1684

Merged

Conversation

sardination
Copy link
Contributor

Since FromDatum for String creates a Rust-allocated copy of the string data, it makes sense to free the palloc'ed varlena created when detoasting the Datum for string conversion.

This PR also includes a function rename to match the function name in Postgres.

pgrx/src/varlena.rs Show resolved Hide resolved
pgrx/src/datum/from.rs Outdated Show resolved Hide resolved
pgrx/src/datum/from.rs Outdated Show resolved Hide resolved
pgrx/src/datum/from.rs Outdated Show resolved Hide resolved
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Thanks!

@workingjubilee workingjubilee merged commit beb7901 into pgcentralfoundation:develop May 2, 2024
4 of 5 checks passed
@philippemnoel philippemnoel deleted the free-str-varlena branch June 20, 2024 18:15
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