[NFC][sanitizer] constexpr StackStore::StackStore()
authorVitaly Buka <vitalybuka@google.com>
Thu, 18 Nov 2021 22:11:54 +0000 (14:11 -0800)
committerVitaly Buka <vitalybuka@google.com>
Fri, 19 Nov 2021 03:24:29 +0000 (19:24 -0800)
compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h

index 604e9fb..b26bca9 100644 (file)
@@ -22,6 +22,8 @@ namespace __sanitizer {
 
 class StackStore {
  public:
+  constexpr StackStore() = default;
+
   using Id = uptr;
 
   Id store(const StackTrace &trace);
@@ -34,19 +36,19 @@ class StackStore {
   uptr *alloc(uptr count = 1);
   uptr *tryAlloc(uptr count);
   uptr *refillAndAlloc(uptr count);
-  mutable StaticSpinMutex mtx;  // Protects alloc of new blocks.
-  atomic_uintptr_t region_pos;  // Region allocator for Node's.
-  atomic_uintptr_t region_end;
-  atomic_uintptr_t mapped_size;
+  mutable StaticSpinMutex mtx = {};  // Protects alloc of new blocks.
+  atomic_uintptr_t region_pos = {};  // Region allocator for Node's.
+  atomic_uintptr_t region_end = {};
+  atomic_uintptr_t mapped_size = {};
 
   struct BlockInfo {
     const BlockInfo *next;
     uptr ptr;
     uptr size;
   };
-  const BlockInfo *curr;
+  const BlockInfo *curr = nullptr;
 };
 
 }  // namespace __sanitizer
 
-#endif  // SANITIZER_STACK_STORE_H
\ No newline at end of file
+#endif  // SANITIZER_STACK_STORE_H