[PATCH] D44261: [sanitizer] Align & pad the allocator structures to the cacheline size

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 11:30:03 PST 2018


cryptoad added a comment.

In https://reviews.llvm.org/D44261#1031779, @cryptoad wrote:

> In https://reviews.llvm.org/D44261#1031736, @alekseyshl wrote:
>
> > I think just declaring "struct ALIGNED(kCacheLineSize) ..." is enough. Compiler should take take care of the rest, the structure size will be extended to the multiple of the alignment, the array will be aligned appropriately, right?
>
>
> So this would work with C++11's `alignas` but not with `__attribute__((align()))`. Currently `alignas` is only used in LibFuzzer & XRay, I am not sure what the stance is about bringing it to sanitizer_common.


Nevermind, this seems to work!


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44261





More information about the llvm-commits mailing list