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

Runtime types by value #72

Merged
merged 6 commits into from
Oct 25, 2024
Merged

Runtime types by value #72

merged 6 commits into from
Oct 25, 2024

Conversation

tertsdiepraam
Copy link
Contributor

This PR changes how runtime values are treated significantly. Previously, Roto got a pointer to any runtime value. However, that means that they can't be returned (since the pointee will be deallocated) and in general makes it hard to reason about the correctness. Now, runtime types are passed by value.

To pass a type in by value, we wrap it in Val<T> (for specialization reasons), Roto will take care of the rest.

The types you register now must implement either Copy or Clone. Something that isn't Clone can be made clone by wrapping it in an Arc.

We can think about reference types later.

@tertsdiepraam tertsdiepraam merged commit 6142b26 into main Oct 25, 2024
12 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