Add RealMemory support for MiNGW and BeOS

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15434 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-12-31 17:13:30 +00:00
parent 6000d30f53
commit d6ed3ea87e
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2002-12-31 Kelvin <kelvin@xbar.org>
* Source/NSPage.m (NSRealMemoryAvailable): Add support for MINGW
and BeOS.
2002-12-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSEQ.h: Optimisations for normalising sequences, especially

View file

@ -131,6 +131,17 @@ NSRealMemoryAvailable ()
if ((sysinfo(&info)) != 0)
return 0;
return (unsigned) info.freeram;
#elif __MINGW__
MEMORYSTATUS memory;
GlobalMemoryStatus(&memory);
return (unsigned)memory.dwAvailPhys;
#elif __BEOS__
system_info info;
if (get_system_info(&info) != B_OK)
return 0;
return (unsigned)(info.max_pages - info.used_pages) * B_PAGE_SIZE;
#else
fprintf (stderr, "NSRealMemoryAvailable() not implemented.\n");
return 0;