[all-commits] [llvm/llvm-project] cbcf55: [libc] Maintain proper alignment for the hermetic ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu May 4 11:22:36 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cbcf55d32b62aad9b516cd201de73cb13fbda030
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M libc/test/UnitTest/HermeticTestUtils.cpp
    M libc/test/src/__support/CMakeLists.txt

  Log Message:
  [libc] Maintain proper alignment for the hermetic tests malloc

We use a bump pointer to implement malloc for the hermetic tests.
Currently, we bump the pointer up by any amount. This means that calling
`malloc(1)` will misalign the buffer so any following `malloc(8)`
accesses will not be aligned. This causes problems in architectures
which require alignment.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D149863

More information about the All-commits mailing list