aligned_alloc.rs
aligned_alloc.rs copied to clipboard
Aligned allocation for Rust
The Windows implementation currently works like this: - Reserve a chunk of address space large enough to contain an aligned address where our allocation can fit - Calculate an aligned...
The test allocates 1 MiB aligned to 1 MiB, so it shouldn't really hit OOM (I think). Yet [this log](https://ci.appveyor.com/project/jonas-schievink/aligned-alloc-rs/build/1.0.44/job/e5i4tow0tjcl59ym) indicates that the allocation failed (by returning a NULL pointer)....
`VirtualAlloc` is not a heap. It is a page allocator. Pages are rather large, often 4KB. `VirtualAlloc` cannot be used to allocate part of a page. As such you're wasting...