xla icon indicating copy to clipboard operation
xla copied to clipboard

Refactor: Use `std::align_val_t` for aligned allocation functions.

Open copybara-service[bot] opened this issue 1 week ago • 0 comments

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.

copybara-service[bot] avatar Nov 14 '25 19:11 copybara-service[bot]