chapel-lang/chapel — pull request #695 by bradcray (2014-10-28 23:36:55+00:00)
Title: Fix memory counting tests for cygwin

This commit fixes the count memory tests for Cygwin. Previously, we
were able to use the default sysconf()-based implementation, as on
Linux and get the right answer (or so my memory says). However, now
we seem to be getting a ridiculously small number of physical pages
being returned making the memory counting tests break (e.g.,
test/modules/standard/memory/countMemory.chpl).

Googling briefly, I couldn't find any plausible explanation for why
this would no longer work and plenty of references that still
suggested taking the sysconf() route. However, there were also
indications that calling a windows.h routine was the right thing to do
on Cygwin (or at least a reasonable thing to do), and trying it, it
seemed to work. So rather than struggling with the issue further, I
just switched to it. The only downside is more #ifdefs (yuck), but
that's probably to be expected in a file that's providing
system-oriented interfaces like this.