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

Unified Diff: tools/ProcStats.cpp

Issue 1117923002: Looks like rssPages * pageSize is overflowing on 32-bit Linux... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months 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: tools/ProcStats.cpp
diff --git a/tools/ProcStats.cpp b/tools/ProcStats.cpp
index fc9da230114d9aab7ee81659a01445dd405807d9..a772db422649b84483a6a17e2bf8284cd4993afe 100644
--- a/tools/ProcStats.cpp
+++ b/tools/ProcStats.cpp
@@ -46,10 +46,10 @@
#include <stdio.h>
int sk_tools::getCurrResidentSetSizeMB() {
const long pageSize = sysconf(_SC_PAGESIZE);
- long rssPages = 0;
+ long long rssPages = 0;
if (FILE* statm = fopen("/proc/self/statm", "r")) {
// statm contains: program-size rss shared text lib data dirty, all in page counts.
- int rc = fscanf(statm, "%*d %ld", &rssPages);
+ int rc = fscanf(statm, "%*d %lld", &rssPages);
fclose(statm);
if (rc != 1) {
return -1;
« 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