[PATCH] D90195: [GWP-ASan] Abstract the thread local variables access
Roland McGrath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 26 16:23:55 PDT 2020
mcgrathr accepted this revision.
mcgrathr added a comment.
This revision is now accepted and ready to land.
This is fine as is but there's really no need to carefully pack it into a uint64_t. It would be fine for Fuchsia's special header to have to meet some less trivial API. The main complexity there would be just figuring out the header arrangement so that Fuchsia's header could #include something to define the types it's supposed to use. But AFAICT it doesn't really need to be in guarded_pool_allocator.h like this. That generic header could just declare `static ThreadLocalPackedVariables *getThreadLocals();`. Then the platform header can provide the `inline` defn outside the class scope, and that header only needs to be used in guarded_pool_allocator.cpp itself.
================
Comment at: compiler-rt/lib/gwp_asan/guarded_pool_allocator.h:245
+ ThreadLocalPackedVariables *getThreadLocals() {
+#if GWP_ASAN_HAS_PLATFORM_TLS_SLOT
----------------
Seems like this should be static since it can never return something that's actually specific to the instance.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90195/new/
https://reviews.llvm.org/D90195
More information about the llvm-commits
mailing list