X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fget-rusage-as.c;h=7ab1c93153f71360228ed122eeef48dc8dcd8568;hb=341d4ca5473e77c703c16eb7f7c7a15f5c416ed5;hp=3ca13660084b883f707d851d619f5f14313368d6;hpb=6bd94e92ae44fbb68d228ec023a1c17c2a26fe63;p=gnulib.git diff --git a/lib/get-rusage-as.c b/lib/get-rusage-as.c index 3ca136600..7ab1c9315 100644 --- a/lib/get-rusage-as.c +++ b/lib/get-rusage-as.c @@ -653,7 +653,11 @@ get_rusage_as_via_iterator (void) 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;