[compiler-rt] r196112 - [sanitizer] Allow InternalMmapVector construction with zero capacity.
Sergey Matveev
earthdok at google.com
Mon Dec 2 07:41:04 PST 2013
Author: smatveev
Date: Mon Dec 2 09:41:04 2013
New Revision: 196112
URL: http://llvm.org/viewvc/llvm-project?rev=196112&view=rev
Log:
[sanitizer] Allow InternalMmapVector construction with zero capacity.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=196112&r1=196111&r2=196112&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Mon Dec 2 09:41:04 2013
@@ -320,8 +320,7 @@ template<typename T>
class InternalMmapVector {
public:
explicit InternalMmapVector(uptr initial_capacity) {
- CHECK_GT(initial_capacity, 0);
- capacity_ = initial_capacity;
+ capacity_ = Min(initial_capacity, (uptr)1);
size_ = 0;
data_ = (T *)MmapOrDie(capacity_ * sizeof(T), "InternalMmapVector");
}
More information about the llvm-commits
mailing list