[all-commits] [llvm/llvm-project] 719ab7: scudo: Make it thread-safe to set some runtime con...

pcc via All-commits all-commits at lists.llvm.org
Wed Sep 30 09:43:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 719ab7309eb7b7b5d802273b0f1871d6cdb965b1
      https://github.com/llvm/llvm-project/commit/719ab7309eb7b7b5d802273b0f1871d6cdb965b1
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2020-09-30 (Wed, 30 Sep 2020)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/atomic_helpers.h
    M compiler-rt/lib/scudo/standalone/combined.h
    A compiler-rt/lib/scudo/standalone/options.h
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/wrappers_c.inc

  Log Message:
  -----------
  scudo: Make it thread-safe to set some runtime configuration flags.

Move some of the flags previously in Options, as well as the
UseMemoryTagging flag previously in the primary allocator, into an
atomic variable so that it can be updated while other threads are
running. Relaxed accesses are used because we only have the requirement
that the other threads see the new value eventually.

The code is set up so that the variable is generally loaded once per
allocation function call with the exception of some rarely used code
such as error handlers. The flag bits can generally stay in a register
during the execution of the allocation function which means that they
can be branched on with minimal overhead (e.g. TBZ on aarch64).

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




More information about the All-commits mailing list