mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
b37baacb77
commit
c57747bd2f
2 changed files with 16 additions and 0 deletions
|
@ -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>
|
2002-12-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSEQ.h: Optimisations for normalising sequences, especially
|
* Source/GSEQ.h: Optimisations for normalising sequences, especially
|
||||||
|
|
|
@ -131,6 +131,17 @@ NSRealMemoryAvailable ()
|
||||||
if ((sysinfo(&info)) != 0)
|
if ((sysinfo(&info)) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
return (unsigned) info.freeram;
|
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
|
#else
|
||||||
fprintf (stderr, "NSRealMemoryAvailable() not implemented.\n");
|
fprintf (stderr, "NSRealMemoryAvailable() not implemented.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue