[libc-commits] [libc] [libc] Add aligned_alloc (PR #96586)
Paul Kirth via libc-commits
libc-commits at lists.llvm.org
Tue Jun 25 10:03:32 PDT 2024
================
@@ -261,6 +262,40 @@ class Block {
constexpr Block(size_t prev_outer_size, size_t outer_size);
+ bool usable_space_is_aligned(size_t alignment) const {
+ return reinterpret_cast<uintptr_t>(usable_space()) % alignment == 0;
+ }
+
+ size_t extra_space_for_adjustment(size_t alignment) const {
----------------
ilovepi wrote:
Maybe something like this communicates the intent better? There's lots of ways to phrase this, but `extra_space_for_adjustment` doesn't communicate much IMO.
```suggestion
size_t padding_for_alignment(size_t alignment) const {
```
https://github.com/llvm/llvm-project/pull/96586
More information about the libc-commits
mailing list