-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Description
We could prevent the possibility of any future memory leaks by:
- Introduce a trait
Arena. - Implement it for:
- all primitive types which do not own external allocations -
u32,&stretc. oxc_allocator'sBox,VecandString.
- all primitive types which do not own external allocations -
- Create a derive macro for the trait which requires all struct fields / enum variants to also be
Arena(same as a type can only beCloneif all its constituent parts are alsoClone). #[derive(Arena)]on all AST types.- Add a bound to
Allocator::alloc<T: Arena>.
The compiler will then make it impossible to add any type which owns data external to the arena to the AST, or allocate one in the arena.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackPriority
None yet