uptr size_;
};
+template <typename T>
+bool operator==(const InternalMmapVectorNoCtor<T> &lhs,
+ const InternalMmapVectorNoCtor<T> &rhs) {
+ if (lhs.size() != rhs.size()) return false;
+ return internal_memcmp(lhs.data(), rhs.data(), lhs.size() * sizeof(T)) == 0;
+}
+
+template <typename T>
+bool operator!=(const InternalMmapVectorNoCtor<T> &lhs,
+ const InternalMmapVectorNoCtor<T> &rhs) {
+ return !(lhs == rhs);
+}
+
template<typename T>
class InternalMmapVector : public InternalMmapVectorNoCtor<T> {
public:
CHECK_EQ(0U, empty_vector.size());
}
+TEST(SanitizerCommon, InternalMmapVectorEq) {
+ InternalMmapVector<uptr> vector1;
+ InternalMmapVector<uptr> vector2;
+ for (uptr i = 0; i < 100; i++) {
+ vector1.push_back(i);
+ vector2.push_back(i);
+ }
+ EXPECT_TRUE(vector1 == vector2);
+ EXPECT_FALSE(vector1 != vector2);
+
+ vector1.push_back(1);
+ EXPECT_FALSE(vector1 == vector2);
+ EXPECT_TRUE(vector1 != vector2);
+
+ vector2.push_back(1);
+ EXPECT_TRUE(vector1 == vector2);
+ EXPECT_FALSE(vector1 != vector2);
+
+ vector1[55] = 1;
+ EXPECT_FALSE(vector1 == vector2);
+ EXPECT_TRUE(vector1 != vector2);
+}
+
void TestThreadInfo(bool main) {
uptr stk_addr = 0;
uptr stk_size = 0;