Files
Alexey MilovidovandClaude Opus 4.8 d4ad8bf0ca Address review: honor alignof(T) for driftsort heap scratch buffer
The driftsort scratch buffer is reinterpreted as `T *` and accessed as `T &`,
so it must satisfy `alignof(T)`. The stack buffer uses `alignas(T)`, but the
heap path allocated with plain `new std::byte[]`, which only guarantees the
default new alignment. For an over-aligned trivially-copyable `T` (e.g.
`alignas(64)`) on the heap path this produced under-aligned `T` references.

Allocate the heap scratch with aligned `operator new[]` plus a matching
aligned `operator delete[]` deleter.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-07 04:46:37 +00:00
..
…
…

C++ port of driftsort (stable sort) by Orson Peters & Lukas Bergdoll. Upstream (Rust): https://github.com/Voultapher/driftsort. Dual-licensed MIT / Apache-2.0. See LICENSE.