tcmalloc: Fix thread-safety (annotalysis) annotations

Chromium's fork of gperftools/tcmalloc contains some thread-safety
annotations; however those annotations have not been exercised for
some time, as they used macros/attributes only supported by a
legacy branch of gcc. converted those macros to support modern
versions of clang; this CR fixes the annotations that were enabled.
For the most part, this just requires re-enabling annotations on
member functions that take/release locks. For the tcmalloc fork
(pre-fork and post-fork) handlers, we mark the functions as
exempt from this analysis, as it takes a dynamic number of locks.

* Manually enabled "-Wthread-safety" for host tool, built base/allocator

Change-Id: I66aeff3c7d3c251ffb0400fcf4bc79ce8e222c6e
Reviewed-by: Primiano Tucci <>
Commit-Queue: Venkatesh Srinivas <>
Cr-Commit-Position: refs/heads/master@{#856342}
GitOrigin-RevId: fe744a3cae1af8e14f7e42044921def8514481e9
4 files changed
tree: 4ebd93c62c7554b5b22a5707fbfca3f4527c331b
  1. src/