This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] libiberty/physmem support for w32


Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz> writes:

> Hello
>
> This adds physmem support for _WIN32. Note that cygwin doesn't define
> _WIN32 by default.  However, cygwin doesn't need this because it has
>  working sysconf.
>
> The code may seem overly complicated.  Here is the reason: All win32
> system have GlobalMemoryStatus which provides the requested values.
> However, GlobalMemoryStatus is broken for physmen > 4GB, returning
> physmem modulo 4GB.  GlobalMemoryStatusEx overcomes this, but is
> onlay available on Win2k and WinXP, AFAICT.  Hence we try a runtime
> link to GlobalMemoryStatusEx in the shared kernel library rather
> than a load time link.

Please factor common code out to a helper routine.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]