[all-commits] [llvm/llvm-project] a45877: [scudo] Get rid of initLinkerInitialized

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed May 26 09:54:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a45877eea8c424cd91bc1f7749313c9cb3aab285
      https://github.com/llvm/llvm-project/commit/a45877eea8c424cd91bc1f7749313c9cb3aab285
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp
    M compiler-rt/lib/scudo/standalone/bytemap.h
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/local_cache.h
    M compiler-rt/lib/scudo/standalone/mutex.h
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/quarantine.h
    M compiler-rt/lib/scudo/standalone/secondary.h
    M compiler-rt/lib/scudo/standalone/stats.h
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
    M compiler-rt/lib/scudo/standalone/tsd.h
    M compiler-rt/lib/scudo/standalone/tsd_exclusive.h
    M compiler-rt/lib/scudo/standalone/tsd_shared.h

  Log Message:
  -----------
  [scudo] Get rid of initLinkerInitialized

Now that everything is forcibly linker initialized, it feels like a
good time to get rid of the `init`/`initLinkerInitialized` split.

This allows to get rid of various `memset` construct in `init` that
gcc complains about (this fixes a Fuchsia open issue).

I added various `DCHECK`s to ensure that we would get a zero-inited
object when entering `init`, which required ensuring that
`unmapTestOnly` leaves the object in a good state (tests are currently
the only location where an allocator can be "de-initialized").

Running the tests with `--gtest_repeat=` showed no issue.

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




More information about the All-commits mailing list