2010-01-07 Zoltan Horvath <zoltan@webkit.org>
authorzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jan 2010 12:13:53 +0000 (12:13 +0000)
committerzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jan 2010 12:13:53 +0000 (12:13 +0000)
        Reviewed by Holger Freyther.

        [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
        https://bugs.webkit.org/show_bug.cgi?id=33312

        Using of operator += cause compile error on Mac, so it is changed to
        "= static_cast<AllocAlignmentInteger*>(old_ptr) + 1".

        * wtf/FastMalloc.cpp:
        (WTF::TCMallocStats::realloc):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@52918 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/wtf/FastMalloc.cpp

index 660aa13..dbbbdd6 100644 (file)
@@ -2,6 +2,19 @@
 
         Reviewed by Holger Freyther.
 
 
         Reviewed by Holger Freyther.
 
+        [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
+        https://bugs.webkit.org/show_bug.cgi?id=33312
+
+        Using of operator += cause compile error on Mac, so it is changed to
+        "= static_cast<AllocAlignmentInteger*>(old_ptr) + 1".
+
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMallocStats::realloc):
+
+2010-01-07  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Holger Freyther.
+
         [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
         https://bugs.webkit.org/show_bug.cgi?id=33312
 
         [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
         https://bugs.webkit.org/show_bug.cgi?id=33312
 
index a9b78eb..886dbe4 100644 (file)
@@ -3795,7 +3795,7 @@ void* realloc(void* old_ptr, size_t new_size) {
     return new_ptr;
   } else {
 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION)
     return new_ptr;
   } else {
 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION)
-    old_ptr += sizeof(AllocAlignmentInteger); // Set old_ptr back to the user pointer.
+    old_ptr = static_cast<AllocAlignmentInteger*>(old_ptr) + 1; // Set old_ptr back to the user pointer.
 #endif
     return old_ptr;
   }
 #endif
     return old_ptr;
   }