[scudo] Get rid of initLinkerInitialized
authorKostya Kortchinsky <kostyak@google.com>
Tue, 25 May 2021 22:00:58 +0000 (15:00 -0700)
committerKostya Kortchinsky <kostyak@google.com>
Wed, 26 May 2021 16:53:40 +0000 (09:53 -0700)
commita45877eea8c424cd91bc1f7749313c9cb3aab285
treeda9f88c30332a6ac338a7af89fa58918f0b42299
parent27d3528acf8aacc62a955dc13b0f08d4167b5b48
[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
16 files changed:
compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp
compiler-rt/lib/scudo/standalone/bytemap.h
compiler-rt/lib/scudo/standalone/combined.h
compiler-rt/lib/scudo/standalone/local_cache.h
compiler-rt/lib/scudo/standalone/mutex.h
compiler-rt/lib/scudo/standalone/primary32.h
compiler-rt/lib/scudo/standalone/primary64.h
compiler-rt/lib/scudo/standalone/quarantine.h
compiler-rt/lib/scudo/standalone/secondary.h
compiler-rt/lib/scudo/standalone/stats.h
compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
compiler-rt/lib/scudo/standalone/tsd.h
compiler-rt/lib/scudo/standalone/tsd_exclusive.h
compiler-rt/lib/scudo/standalone/tsd_shared.h