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

Missing alignment checks #6

Closed
RReverser opened this issue Sep 28, 2018 · 1 comment
Closed

Missing alignment checks #6

RReverser opened this issue Sep 28, 2018 · 1 comment

Comments

@RReverser
Copy link

StackBox and SmallBox currently expect any data to be aligned to usize but in reality type can have arbitrarily large alignment, and putting it into usize-aligned stack storage can cause all sorts of platform-specific issues.

While there is currently no way to allocate on stack with custom alignment, constructors of these types should at least check that alignment of type not any larger than the expected one, similarly to how they already check type sizes.

@andylokandy
Copy link
Owner

Good point! I'll do it in the next update.

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