[all-commits] [llvm/llvm-project] 1d767b: [scudo] Align objects with alignas

Vitaly Buka via All-commits all-commits at lists.llvm.org
Wed May 5 13:29:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d767b13bfad806bf584e0b054eb7d00a494591d
      https://github.com/llvm/llvm-project/commit/1d767b13bfad806bf584e0b054eb7d00a494591d
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2021-05-05 (Wed, 05 May 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/primary_test.cpp

  Log Message:
  -----------
  [scudo] Align objects with alignas

Operator new must align allocations for types with large alignment.

Before c++17 behavior was implementation defined and both clang and gc++
before 11 ignored alignment. Miss-aligned objects mysteriously crashed
tests on Ubuntu 14.

Alternatives are compile with -std=c++17 or -faligned-new, but they were
discarded as less portable.

Reviewed By: hctim

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




More information about the All-commits mailing list