[libc-commits] [libc] [libc] Fix malloc Block alignment issue on riscv32 (PR #117815)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Fri Jan 17 10:23:24 PST 2025


================
@@ -241,16 +242,15 @@ TEST_FOR_EACH_ALLOCATOR(AlignedAlloc, 2048) {
 
 // This test is not part of the TEST_FOR_EACH_ALLOCATOR since we want to
 // explicitly ensure that the buffer can still return aligned allocations even
-// if the underlying buffer is at most aligned to the Block alignment. This
-// is so we can check that we can still get aligned allocations even if the
-// underlying buffer is not aligned to the alignments we request.
-TEST(LlvmLibcFreeListHeap, AlignedAllocOnlyBlockAligned) {
+// if the underlying buffer is unaligned. This is so we can check that we can
+// still get aligned allocations even if the underlying buffer is not aligned to
+// the alignments we request.
+TEST(LlvmLibcFreeListHeap, AlignedAllocUnalignedBuffer) {
   constexpr size_t BUFFER_SIZE = 4096;
----------------
nickdesaulniers wrote:

```
llvm-project/libc/test/src/__support/freelist_heap_test.cpp:249:20: warning: unused variable 'BUFFER_SIZE' [-Wunused-variable]
  249 |   constexpr size_t BUFFER_SIZE = 4096;
      |                    ^~~~~~~~~~~
```

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


More information about the libc-commits mailing list