[libc-commits] [libc] [libc] Add aligned_alloc (PR #96586)

via libc-commits libc-commits at lists.llvm.org
Tue Jun 25 16:18:09 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 {
----------------
PiJoules wrote:

Done

https://github.com/llvm/llvm-project/pull/96586


More information about the libc-commits mailing list