xla
xla copied to clipboard
Refactor: Use `std::align_val_t` for aligned allocation functions.
Refactor: Use std::align_val_t for aligned allocation functions.
This change updates AlignedMalloc, AlignedSizedFree, and AlignedAllocator to use std::align_val_t for specifying alignment, aligning with standard C++ practices for overaligned allocation. Deprecated inline overloads are provided to ease the transition for existing callers.
This matches the standard new(size_t size, std::align_val_t alignment)
and delete(void* ptr, size_t size, std::align_val_t alignment) ordering.