[PATCH] D71342: [sanitizer] Construct InternalMmapVector without memory allocation.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 00:09:40 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa57adc7a0b0d: [sanitizer] Construct InternalMmapVector without memory allocation. (authored by ikudrin).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71342/new/

https://reviews.llvm.org/D71342

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_common.h
  compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp


Index: compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
+++ compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
@@ -131,7 +131,7 @@
     EXPECT_EQ((uptr)i, vector.size());
   }
   InternalMmapVector<uptr> empty_vector;
-  CHECK_GT(empty_vector.capacity(), 0U);
+  CHECK_EQ(empty_vector.capacity(), 0U);
   CHECK_EQ(0U, empty_vector.size());
 }
 
Index: compiler-rt/lib/sanitizer_common/sanitizer_common.h
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -552,7 +552,7 @@
 template<typename T>
 class InternalMmapVector : public InternalMmapVectorNoCtor<T> {
  public:
-  InternalMmapVector() { InternalMmapVectorNoCtor<T>::Initialize(1); }
+  InternalMmapVector() { InternalMmapVectorNoCtor<T>::Initialize(0); }
   explicit InternalMmapVector(uptr cnt) {
     InternalMmapVectorNoCtor<T>::Initialize(cnt);
     this->resize(cnt);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71342.234224.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/1dd2301d/attachment.bin>


More information about the llvm-commits mailing list