Title: [92387] trunk/Source/ThirdParty
Revision
92387
Author
dslo...@google.com
Date
2011-08-04 10:52:20 -0700 (Thu, 04 Aug 2011)

Log Message

        https://bugs.webkit.org/show_bug.cgi?id=61812
        TestWebKitApi breaks in release mode due to gtest incompatibility with fast malloc

        Disable fast malloc for offending class (::std::strstream) in gtest.
        This looks like the most non-intrusive solution.

        Reviewed by David Levin.

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ChangeLog (92386 => 92387)


--- trunk/Source/ThirdParty/ChangeLog	2011-08-04 17:48:40 UTC (rev 92386)
+++ trunk/Source/ThirdParty/ChangeLog	2011-08-04 17:52:20 UTC (rev 92387)
@@ -1,3 +1,19 @@
+2011-08-03  Dmitry Lomov  <dslo...@google.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=61812
+        TestWebKitApi breaks in release mode due to gtest incompatibility with fast malloc
+
+        Disable fast malloc for offending class (::std::strstream) in gtest.
+        This looks like the most non-intrusive solution.
+
+        Reviewed by David Levin.
+
+        * gtest/include/gtest/internal/gtest-port.h:
+        (testing::internal::StrStream::operator new):
+        (testing::internal::StrStream::operator new[]):
+        (testing::internal::StrStream::operator delete):
+        (testing::internal::StrStream::operator delete[]):
+
 2011-07-05  Adam Barth  <aba...@webkit.org>
 
         Import qunit _javascript_ unit testing framework

Modified: trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h (92386 => 92387)


--- trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h	2011-08-04 17:48:40 UTC (rev 92386)
+++ trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h	2011-08-04 17:52:20 UTC (rev 92387)
@@ -609,8 +609,30 @@
 
 class String;
 
-typedef ::std::stringstream StrStream;
+class StrStream : public ::std::stringstream {
+ public:
+  void* operator new(size_t, void* p) { return p; }
+  void* operator new[](size_t, void* p) { return p; }
 
+  void* operator new(size_t size) {
+    return malloc(size);
+  }
+
+  void operator delete(void* p) {
+    free(p);
+  }
+
+  void* operator new[](size_t size) {
+    return malloc(size);
+  }
+
+  void operator delete[](void* p) {
+    free(p);
+  }
+};
+
+
+
 // A helper for suppressing warnings on constant condition.  It just
 // returns 'condition'.
 GTEST_API_ bool IsTrue(bool condition);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to