[all-commits] [llvm/llvm-project] 9903b0: [GWP-ASan] Move random-related code in the allocator

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Thu Oct 22 11:52:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9903b0586cfb76ef2401c342501e61e1bd3daa0f
      https://github.com/llvm/llvm-project/commit/9903b0586cfb76ef2401c342501e61e1bd3daa0f
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M compiler-rt/lib/gwp_asan/CMakeLists.txt
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
    M compiler-rt/lib/gwp_asan/options.inc
    M compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp
    R compiler-rt/lib/gwp_asan/random.cpp
    R compiler-rt/lib/gwp_asan/random.h

  Log Message:
  -----------
  [GWP-ASan] Move random-related code in the allocator

We need to have all thread specific data packed into a single `uintptr_t`
for the upcoming Fuchsia support. We can move the `RandomState` into the
`ThreadLocalPackedVariables`, reducing the size of `NextSampleCounter`
to 31 bits (or we could reduce `RandomState` to 31 bits).

We move `getRandomUnsigned32` into the platform agnostic part of the
class, and `initPRNG` in the platform specific part.

`ScopedBoolean` is replaced by actual assignments since non-const
references to bitfields are prohibited.

`random.{h,cpp}` are removed.

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




More information about the All-commits mailing list