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

enums should be optimized to nullable or tagged pointers when possible #5025

Closed
thestinger opened this issue Feb 19, 2013 · 1 comment
Closed

Comments

@thestinger
Copy link
Contributor

Any enums resembling Option<~T> (a pointer and an empty variant) should be optimized to a nullable pointer. This would really help for linked containers (trees, tries, linked lists).

Additionally, there's a fair bit of space that can be used inside the pointer itself for storing the discriminant due to alignment.

@catamorphism
Copy link
Contributor

I'll point you to the existing discussion at #1271 (a longstanding enhancement request) :-)

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
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

2 participants