... resulting in apparently negative memory usage:
(-2040/2058MB 5867) 1.81s serialize-8888 skp top25desk_google_com_calendar_.skp
Turns out long is 32-bit there, long long is 64-bit.
NOTREECHECKS=true
BUG=skia:
Review URL: https://codereview.chromium.org/
1117923002
#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;