|
|
|
|
|
by JJJollyjim
596 days ago
|
|
It is in fact documented that you can't do this: "Currently the default global allocator is unspecified. Libraries, however, like cdylibs and staticlibs are guaranteed to use the System by default.", however: "[std::alloc::System] is based on malloc on Unix platforms and HeapAlloc on Windows, plus related functions. However, it is not valid to mix use of the backing system allocator with System, as this implementation may include extra work, such as to serve alignment requests greater than the alignment provided directly by the backing system allocator." https://doc.rust-lang.org/std/alloc/index.html
https://doc.rust-lang.org/std/alloc/struct.System.html |
|
Surely the system allocator provides memalign() or similar? Does Windows not have one of those?