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

refact(rivetc.codegen): don't alloc tagged enum's struct values #55

Merged
merged 8 commits into from
Dec 16, 2023

Conversation

StunxFS
Copy link
Member

@StunxFS StunxFS commented Dec 16, 2023

With this PR, this snippet:

enum Tagged {
    StructVariant {
       field: int;
    }
}

func main() {
    t := Tagged.StructVariant(field: 1);
}

Will no longer require a heap allocation.

Mutability is also forced more, not only are the fields verified to be mutable, but also the objects that have said fields.

@StunxFS StunxFS merged commit 542ce20 into main Dec 16, 2023
16 checks passed
@StunxFS StunxFS deleted the dont_alloc_tagged_enum_struct branch December 16, 2023 20:15
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