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

feat(engine): GcScope #452

Merged
merged 2 commits into from
Nov 1, 2024
Merged

feat(engine): GcScope #452

merged 2 commits into from
Nov 1, 2024

Conversation

aapoalas
Copy link
Collaborator

One more step towards interleaved GC. The GcScope ZST (zero-sized type) carries two lifetimes, the "scope" lifetime and the "GC" lifetime. The GC lifetime is somewhat related to the &mut Agent borrow lifetime in that code that does not receive &mut Agent cannot perform GC, but the intention is that neither can it without the GcScope's 'gc lifetime. In the future, if/once &mut Agent becomes &Agent then the GC will become possible with just &Agent + 'gc.

I could probably maybe move this lifetime into a GcContext that is a #[repr(transparent)] over Agent with the GC and Scope lifetimes embedded into that... And then NoGcContext that is similar but now with a shared borrow over the GC lifetime...

I'll try that in a separate branch.

@aapoalas aapoalas force-pushed the feat/engine-context branch from 8c28f2a to 21eb5d9 Compare November 1, 2024 20:40
@aapoalas aapoalas force-pushed the feat/engine-context branch from 21eb5d9 to 9d3512e Compare November 1, 2024 20:50
@aapoalas aapoalas merged commit 2be2a80 into main Nov 1, 2024
1 check passed
@aapoalas aapoalas deleted the feat/engine-context branch November 1, 2024 21:04
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