Remove 64-bit unclean line from heap size estimation
authorerikcorry <erikcorry@chromium.org>
Wed, 20 May 2015 09:44:21 +0000 (02:44 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 20 May 2015 09:44:06 +0000 (09:44 +0000)
R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1133243006

Cr-Commit-Position: refs/heads/master@{#28503}

src/heap/heap.h

index 34c5c60..e024c94 100644 (file)
@@ -1093,7 +1093,10 @@ class Heap {
 
   inline intptr_t PromotedTotalSize() {
     int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
-    if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt);
+    if (total > std::numeric_limits<intptr_t>::max()) {
+      // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations.
+      return std::numeric_limits<intptr_t>::max();
+    }
     if (total < 0) return 0;
     return static_cast<intptr_t>(total);
   }