[PATCH] D38183: [scudo] Scudo thread specific data refactor, part 2

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 09:51:00 PDT 2017


cryptoad created this revision.
Herald added a subscriber: srhines.

Following https://reviews.llvm.org/D38139, we now consolidate the TSD definition, merging the shared
TSD definition with the exclusive TSD definition. We introduce a boolean set
at initializaton denoting the need for the TSD to be unlocked or not. This
adds some unused members to the exclusive TSD, but increases consistency and
reduces the definitions fragmentation.

We remove the fallback mechanism from `scudo_allocator.cpp` and add a fallback
TSD in the non-shared version. Since the shared version doesn't require one,
this makes overall more sense.

There are a couple of additional cosmetic changes: removing the header guards
from the remaining `.inc` files, added error string to a `CHECK`.

Question to reviewers: I thought about friending `getTSDAndLock` in `ScudoTSD`
so that the `FallbackTSD` could `Mutex.Lock()` directly instead of `lock()`
which involved zeroing out the `Precedence`, which is unused otherwise. Is it
worth doing?


https://reviews.llvm.org/D38183

Files:
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_tls.h
  lib/scudo/scudo_tls_android.cpp
  lib/scudo/scudo_tls_android.inc
  lib/scudo/scudo_tls_context_android.inc
  lib/scudo/scudo_tls_context_linux.inc
  lib/scudo/scudo_tls_linux.cpp
  lib/scudo/scudo_tls_linux.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38183.116364.patch
Type: text/x-patch
Size: 11277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170922/e11b8e70/attachment.bin>


More information about the llvm-commits mailing list