Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: src/heap/spaces.cc

Issue 725453002: Fix the paged space statistics report error under debug mode. Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 2b696ea8eb5238f91f5ade5702cc663f4c09cc73..aa244ad94a1f86d27a148e6a8c484173b31af9da 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -2791,7 +2791,8 @@ void PagedSpace::CollectCodeStatistics() {
void PagedSpace::ReportStatistics() {
- int pct = static_cast<int>(Available() * 100 / Capacity());
+ int pct = Capacity() > 0 ? static_cast<int>(Available() * 100 / Capacity())
+ : 0;
PrintF(" capacity: %" V8_PTR_PREFIX
"d"
", waste: %" V8_PTR_PREFIX
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698