4 ms·
Rust has alignment annotations. https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md https://github.com/rust-lang/rfcs/blob/master/text/1358-r
by the8472 8y ago
Rust has alignment annotations.
https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md https://github.com/rust-lang/rfcs/blob/master/text/1358-repr...
- stochastic_monk 8y agoEdit: RcouF1 posted a more thorough response covering cache coherence as well earlier, which I hadn’t seen. Read that instead. https://news.ycombinator.com/item?id=18010256 https://news.ycombinator.com/item?id=18010256 Original post: As does C++ as of 11. [0] For heap allocations, one used the POSIX (not stdlib) posix_memalign until C++17/C11, when std::aligned_alloc became standard. [1] The other option was manually aligning heap memory; it’s so much more convenient to use a transparent aligned allocator. [0] https://en.cppreference.com/w/cpp/language/alignas https://en.cppreference.com/w/cpp/language/alignas [1] https://en.cppreference.com/w/cpp/memory/c/aligned_alloc https://en.cppreference.com/w/cpp/memory/c/aligned_alloc