Fix build on windows
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Dec 2007 03:53:52 +0000 (03:53 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Dec 2007 03:53:52 +0000 (03:53 +0000)
Reviewd by Stephanie

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::IncrementalScavenge):

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

JavaScriptCore/ChangeLog
JavaScriptCore/wtf/FastMalloc.cpp

index bad34e9..bc09a9b 100644 (file)
@@ -1,3 +1,12 @@
+2007-12-14  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Stephanie.
+
+        Fix build on windows
+
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMalloc_PageHeap::IncrementalScavenge):
+
 2007-12-14  Dan Bernstein  <mitz@apple.com>
 
         - try again to fix the Windows build
index e47922a..c370e45 100644 (file)
@@ -218,6 +218,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
 #include "TCPageMap.h"
 #include "TCSpinLock.h"
 #include "TCSystemAlloc.h"
+#include <algorithm>
 #include <errno.h>
 #include <new>
 #include <pthread.h>
@@ -1349,7 +1350,7 @@ void TCMalloc_PageHeap::IncrementalScavenge(Length n) {
                              static_cast<size_t>(s->length << kPageShift));
       DLL_Prepend(&slist->returned, s);
 
-      scavenge_counter_ = max(64UL, min(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
+      scavenge_counter_ = std::max<size_t>(64UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
 //      fprintf(stderr, "Released %zu pages at 0x%08zx to the system from index %zu.  Delaying for %lld pages before scavenging next.\n", s->length, s->start << kPageShift, index, scavenge_counter_);
 
       if (index == kMaxPages && !DLL_IsEmpty(&slist->normal))