[PATCH] D41513: [SanitizerCoverage][Fuchsia] Make TracePcGuardController linker-initialized

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 16:31:15 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL322424: [SanitizerCoverage][Fuchsia] Make TracePcGuardController linker-initialized (authored by phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D41513?vs=127938&id=129733#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D41513

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
@@ -49,7 +49,7 @@
 
 // Collects trace-pc guard coverage.
 // This class relies on zero-initialization.
-class TracePcGuardController {
+class TracePcGuardController final {
  public:
   // For each PC location being tracked, there is a u32 reserved in global
   // data called the "guard".  At startup, we assign each guard slot a
@@ -113,11 +113,11 @@
   // We can always spare the 32G of address space.
   static constexpr size_t MappingSize = sizeof(uptr) << 32;
 
-  BlockingMutex setup_lock_;
-  uptr *array_;
-  u32 next_index_;
-  zx_handle_t vmo_;
-  char vmo_name_[ZX_MAX_NAME_LEN];
+  BlockingMutex setup_lock_{LINKER_INITIALIZED};
+  uptr *array_{};
+  u32 next_index_{};
+  zx_handle_t vmo_{};
+  char vmo_name_[ZX_MAX_NAME_LEN]{};
 
   size_t DataSize() const { return next_index_ * sizeof(uintptr_t); }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41513.129733.patch
Type: text/x-patch
Size: 1110 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180113/488a3c8c/attachment.bin>


More information about the llvm-commits mailing list