From 235d8b4f94d592ab95d0d0875d264f8f120c40d1 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Mon, 6 Aug 2012 13:23:52 +0000 Subject: [PATCH] Fix integer division truncation error. Review URL: https://chromiumcodereview.appspot.com/10831148 Patch from Nico Weber . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12261 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mark-compact.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mark-compact.cc b/src/mark-compact.cc index cf4c2f2..261cf9e 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -601,7 +601,7 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { static const int kMaxMaxEvacuationCandidates = 1000; int number_of_pages = space->CountTotalPages(); int max_evacuation_candidates = - static_cast(sqrt(static_cast(number_of_pages / 2)) + 1); + static_cast(sqrt(number_of_pages / 2.0) + 1); if (FLAG_stress_compaction || FLAG_always_compact) { max_evacuation_candidates = kMaxMaxEvacuationCandidates; -- 2.7.4