-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tags with more than one variant are always 4 byte aligned #792
Comments
This problem is more urgent as we support more architectures. In general, I think tags should be laid out as follows (this is fairly close to what the current code does):
The tricky case of course is with generic types. For something like
where is the data located? That depends on the type of T and its corresponding alignment restrictions. I am not clear on how the current dynamic shape-walking code (GEP-tuple-like, Shape.h, and friends) handles this kind of dynamic alignment. I could see an argument for using a pessimistic alignment (i.e., maximally align the data in tags always), but that seems to waste a lot of space, since the maximal reasonable alignment is probably 16 bytes (vector data), and you only NEED 4 bytes (for the variant ID). For reference, the current behavior is:
|
Subsumed by #1645 |
Add IP_BINDANY for FreeBSD Adds the IP_BINDANY constant for FreeBSD. Thanks!
Because of this code:
Tags always end up 4 byte aligned when they have more than one variant, even when that's wrong.
The text was updated successfully, but these errors were encountered: