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

Eliminate in-heap types #5

Open
jorendorff opened this issue Feb 8, 2017 · 0 comments
Open

Eliminate in-heap types #5

jorendorff opened this issue Feb 8, 2017 · 0 comments

Comments

@jorendorff
Copy link
Owner

The layout of an "heap" (Storage) type is always identical to the layout of the corresponding "stack" type. E.g. the stack type Student is essentially identical to the heap type StudentStorage.

The design has two separate types because moving a value from/into the heap is not quite trivial: when moving a pointer-to-heap-value out, it must be wrapped in a GCRef, and the referent pinned. When moving a GCRef in, the referent must be unpinned. However I don't think the duplication of types is paying for itself.

Unifying the two types would probably lead to better destructor behavior.

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

No branches or pull requests

1 participant