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

Arenassssss #142

Merged
merged 10 commits into from
Sep 21, 2023
Merged

Arenassssss #142

merged 10 commits into from
Sep 21, 2023

Conversation

ibokuri
Copy link
Contributor

@ibokuri ibokuri commented Sep 21, 2023

First half of #135.

Getty will still copy everything so functionally everything should be the same (aside from getting back an arena obviously). I'll update getty-json afterwards and make sure everything's okay, then we can start the optimization half of things with lifetimes.

All allocations made by either Getty or deserializer implementations
will use this new arena allocator. Deserializers can, of course, have a
secondary allocator for anything else they need, but all deserialized
values part of the final value returned to the user by getty.deserialize
should exist within this arena.

This should remove the need for getty.de.free, fix the issue of not
knowing what lifetime an intermediate, deserialized value has, and make
things significantly easier on the error handling side since visitors
and blocks don't need to free anything, they can simply return an error
and getty.deserialize will deinit at the end.
Similar to struct keys, they're never needed again so might as well save
some memory and free em immediately.
@ibokuri ibokuri marked this pull request as ready for review September 21, 2023 02:25
@ibokuri ibokuri merged commit 3c33066 into main Sep 21, 2023
@ibokuri ibokuri deleted the arena branch September 21, 2023 15:41
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