Mercurial > hg > octave-lyh > gnulib-hg
changeset 14178:bdfd0ba6ce2d
get-rusage-as: Improvement for Cygwin.
* lib/get-rusage-as.c (get_rusage_as_via_iterator): On Windows, ignore
areas that are merely reserved.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 18 Jan 2011 19:47:37 +0100 |
parents | c6bc5712a6a9 |
children | c8f2d55830b2 |
files | ChangeLog lib/get-rusage-as.c |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-01-18 Bruno Haible <bruno@clisp.org> + + get-rusage-as: Improvement for Cygwin. + * lib/get-rusage-as.c (get_rusage_as_via_iterator): On Windows, ignore + areas that are merely reserved. + 2011-01-18 Paul Eggert <eggert@cs.ucla.edu> strftime: remove dependencies on multibyte modules
--- a/lib/get-rusage-as.c +++ b/lib/get-rusage-as.c @@ -653,7 +653,11 @@ while (VirtualQuery ((void*)address, &info, sizeof(info)) == sizeof(info)) { if (info.State != MEM_FREE) - total += info.RegionSize; + /* Ignore areas where info.Protect has the undocumented value 0. + This is needed, so that on Cygwin, areas used by malloc() are + distinguished from areas reserved for future malloc(). */ + if (info.Protect != 0) + total += info.RegionSize; address = (unsigned long)info.BaseAddress + info.RegionSize; } return total;