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

Fix memory leak in st_asgeojson, avoid copy #372

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

Maxxen
Copy link
Member

@Maxxen Maxxen commented Aug 15, 2024

yyjson doesn't use the allocator set during document creation by default when using the yyjson_mut_write function, instead allocating the result string through malloc (causing the string to be leaked), but we now use the advanced version taking options (such as which allocator to use) to make sure the resulting string is allocated by the arena. Additionally we also avoid copying the resulting json string to the vector string heap buffer now as we can just point into the arena instead, saving some memory.

Closes #371

@Maxxen Maxxen merged commit d883e28 into duckdb:v1.0.0 Aug 15, 2024
22 checks passed
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.

1 participant