[libcxx-commits] [libcxx] [libcxx] Use `aligned_alloc` for testing instead of `posix_memalign` (PR #101748)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 5 12:08:52 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 97f723bab0f48aca1416b9f946037b39b11d50e9 99272f420df0cb9f99f28874116e4c211abe9cce --extensions h,cpp -- libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp libcxx/test/support/count_new.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/support/count_new.h b/libcxx/test/support/count_new.h
index b9dc0129bd..c55f64401d 100644
--- a/libcxx/test/support/count_new.h
+++ b/libcxx/test/support/count_new.h
@@ -462,7 +462,7 @@ inline void* alocate_aligned_impl(std::size_t size, std::align_val_t align) {
   ret = _aligned_malloc(size, alignment);
 #    elif TEST_STD_VER >= 17
   size_t rounded_size = (size + align - 1) & ~(alignment - 1);
-  ret = aligned_alloc(alignment, size > rounded_size ? size : rounded_size);
+  ret                 = aligned_alloc(alignment, size > rounded_size ? size : rounded_size);
 #    else
   assert(posix_memalign(&ret, std::max(alignment, sizeof(void*)), size) != EINVAL);
 #    endif

``````````

</details>


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


More information about the libcxx-commits mailing list