Skip to content

Conversation

slonkazoid
Copy link

this lets you allocate the code next to the AST so you can avoid lifetime hell

@01mf02
Copy link
Owner

01mf02 commented Aug 5, 2025

Hi @slonkazoid! Before merging this, I would be interested in a concrete use case. Can you show me a code sample that profits from having this functionality?

@slonkazoid
Copy link
Author

i replied (twice) but email got blackholed i guess and github was 500ing

i replied:

cant exactly do that as github is currently 500ing for all PRs but i was parsing filters embedded in other strings, and keeping one arena which i can then pass into the filter parser made sense. issue was that the filter parser has to allocate a new String and it can't return the Modules type because the source String must live as long as it. giving it all the arena's lifetime made sense. however, i've moved onto doing the compilation in the filter parser so i no longer need this feature, but someone else might. looking at typed_arena's api, having a shared reference to Arena doesn't let you deallocate or modify existing entries, so, it should not cause any problems

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