-
Notifications
You must be signed in to change notification settings - Fork 386
Implement aligned_alloc #3577
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
Comments
Ah, but the function spec is completely terrible of course...
There is no guarantee at all for what is a "valid alignment supported by the implementation". So this can basically always return null, great.
All "fundamental" alignments have to be supported -- which I hope doesn't mean we have to support non-power-of-two alignments smaller than |
indeed, |
though asking for too-large alignments is also bad: rust-lang/rust@53bd38b |
That's for that one implementation. But who knows about others...
That's "obviously" a platform bug though, I don't think Miri should model that. |
Looking at the spec again, it says fundamental alignments must be supported. So I think a |
😂 turns out libc doesn't have this function yet... rust-lang/libc#3689. That certainly makes testing harder. |
And some platforms just don't implement it at all, of course, for legacy reasons. |
According to my research, at least all the Unixes Miri currently has any support for do all have it. That's good enough for me to say we just provide it on all Unixes. |
Oh yes, the notable exception is Windows. |
As usual ;)
|
support aligned_alloc for unixes. Fixes rust-lang/miri#3577
support aligned_alloc for unixes. Fixes rust-lang/miri#3577
C11 has a new allocation function: aligned_alloc. We should implement it in Miri. Docs can be found here.
The text was updated successfully, but these errors were encountered: