4 ms·
Edit: 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
by stochastic_monk 8y ago
Edit: 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