mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
statm should report memory as multiples of allocation_granularity instead of page_size
that ensures that values in statm mupltiplied by POSIX _SC_PAGESIZE give the correct values
This commit is contained in:
parent
9ba4744620
commit
6477a48cd1
@ -1251,12 +1251,16 @@ format_process_statm (void *data, char *&destbuf)
|
||||
_pinfo *p = (_pinfo *) data;
|
||||
unsigned long vmsize = 0UL, vmrss = 0UL, vmtext = 0UL, vmdata = 0UL,
|
||||
vmlib = 0UL, vmshare = 0UL;
|
||||
size_t page_scale;
|
||||
if (!get_mem_values (p->dwProcessId, &vmsize, &vmrss, &vmtext, &vmdata,
|
||||
&vmlib, &vmshare))
|
||||
return 0;
|
||||
|
||||
page_scale = wincap.allocation_granularity() / wincap.page_size();
|
||||
destbuf = (char *) crealloc_abort (destbuf, 96);
|
||||
return __small_sprintf (destbuf, "%ld %ld %ld %ld %ld %ld 0\n",
|
||||
vmsize, vmrss, vmshare, vmtext, vmlib, vmdata);
|
||||
vmsize / page_scale, vmrss / page_scale, vmshare / page_scale,
|
||||
vmtext / page_scale, vmlib / page_scale, vmdata / page_scale);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user