From: erikcorry Date: Wed, 20 May 2015 09:44:21 +0000 (-0700) Subject: Remove 64-bit unclean line from heap size estimation X-Git-Tag: upstream/4.7.83~2537 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ff1f53b085832994f8de496853f06229268df9e;p=platform%2Fupstream%2Fv8.git Remove 64-bit unclean line from heap size estimation R=hpayer@chromium.org BUG= Review URL: https://codereview.chromium.org/1133243006 Cr-Commit-Position: refs/heads/master@{#28503} --- diff --git a/src/heap/heap.h b/src/heap/heap.h index 34c5c60..e024c94 100644 --- a/src/heap/heap.h +++ b/src/heap/heap.h @@ -1093,7 +1093,10 @@ class Heap { inline intptr_t PromotedTotalSize() { int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); - if (total > kMaxInt) return static_cast(kMaxInt); + if (total > std::numeric_limits::max()) { + // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. + return std::numeric_limits::max(); + } if (total < 0) return 0; return static_cast(total); }