This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] libiberty/physmem support for w32
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, ghazi at caip dot rutgers dot edu, dj at redhat dot com
- Date: Sun, 23 Feb 2003 16:03:11 -0800
- Subject: Re: [Patch] libiberty/physmem support for w32
- References: <20030223235241.27770.qmail@web21405.mail.yahoo.com>
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