Commit 481112dd authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

app/base/base-utils.c New function that Sven asked for. Somebody please

2007-11-16  Tor Lillqvist  <tml@novell.com>

	* app/base/base-utils.c
	* app/base/base-utils.h (get_physical_memory_size_megabytes): New
	function that Sven asked for. Somebody please fill in Unix
	implementation(s).


svn path=/trunk/; revision=24175
parent 036085fd
2007-11-16 Tor Lillqvist <tml@novell.com>
* app/base/base-utils.c
* app/base/base-utils.h (get_physical_memory_size_megabytes): New
function that Sven asked for. Somebody please fill in Unix
implementation(s).
2007-11-16 Michael Natterer <mitch@gimp.org>
* app/base/temp-buf.c
......
......@@ -25,6 +25,7 @@
#include <glib.h>
#ifdef G_OS_WIN32
#define _WIN32_WINNT 0x0500
#include <windows.h>
#endif
......@@ -54,3 +55,22 @@ get_number_of_processors (void)
return retval;
}
gint
get_physical_memory_size_megabytes (void)
{
gint retval = 0;
#ifdef G_OS_UNIX
/* ??? */
#endif
#ifdef G_OS_WIN32
MEMORYSTATUSEX memory_status;
memory_status.dwLength = sizeof (memory_status);
if (GlobalMemoryStatusEx (&memory_status))
retval = memory_status.ullTotalPhys / (1024*1024);
#endif
return retval;
}
......@@ -20,5 +20,6 @@
#define __BASE_H__
gint get_number_of_processors (void);
gint get_physical_memory_size_megabytes (void);
#endif /* __BASE_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment