diff options
Diffstat (limited to 'util/sparse_set.h')
-rw-r--r-- | util/sparse_set.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/util/sparse_set.h b/util/sparse_set.h index 191ac7c..6764cc7 100644 --- a/util/sparse_set.h +++ b/util/sparse_set.h @@ -183,12 +183,14 @@ void SparseSetT<Value>::resize(int max_size) { dense_.resize(max_size); -#ifdef MEMORY_SANITIZER +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) for (int i = max_size_; i < max_size; i++) { sparse_to_dense_[i] = 0xababababU; dense_[i] = 0xababababU; } #endif +#endif } max_size_ = max_size; if (size_ > max_size_) @@ -224,12 +226,14 @@ template<typename Value> SparseSetT<Value>::SparseSetT(int max_size) { dense_.resize(max_size); size_ = 0; -#ifdef MEMORY_SANITIZER +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) for (int i = 0; i < max_size; i++) { sparse_to_dense_[i] = 0xababababU; dense_[i] = 0xababababU; } #endif +#endif DebugCheckInvariants(); } |