Reviewers: Michael Starzinger,
Message:
I'm not sure if this change is correct. The explicit cast suggests that a
real
floating division was desired here, but it probably doesn't matter too much
either way?
(Found by a compiler warning I'm prototyping, and I'm not sure if it's a
useful
one.)
Description:
Fix integer division truncation error.
Please review this at https://chromiumcodereview.appspot.com/10831148/
SVN Base: http://v8.googlecode.com/svn/trunk/
Affected files:
M src/mark-compact.cc
Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 12227)
+++ src/mark-compact.cc (working copy)
@@ -602,7 +602,7 @@
static const int kMaxMaxEvacuationCandidates = 1000;
int number_of_pages = space->CountTotalPages();
int max_evacuation_candidates =
- static_cast<int>(sqrt(static_cast<double>(number_of_pages / 2)) + 1);
+ static_cast<int>(sqrt(number_of_pages / 2.0) + 1);
if (FLAG_stress_compaction || FLAG_always_compact) {
max_evacuation_candidates = kMaxMaxEvacuationCandidates;
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev