[Xfce4-commits] <midori:master> Implement low_memory_profile for FreeBSD
Christian Dywan
noreply at xfce.org
Sun Mar 25 18:12:02 CEST 2012
Updating branch refs/heads/master
to 7789bafc68c91c265cbc40f0561a510a7c6cd6de (commit)
from 76be3b9aead3f8a5cc915a516ed78d051a804b0a (commit)
commit 7789bafc68c91c265cbc40f0561a510a7c6cd6de
Author: Olivier Duchateau <duchateau.olivier at gmail.com>
Date: Sun Mar 25 17:53:45 2012 +0200
Implement low_memory_profile for FreeBSD
Fixes: https://bugs.launchpad.net/midori/+bug/963833
midori/midori-websettings.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index 0bd4e81..7b13a87 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -26,6 +26,10 @@
#if defined (G_OS_UNIX)
#include <sys/utsname.h>
#endif
+#if defined(__FreeBSD__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+#endif
struct _MidoriWebSettings
{
@@ -353,6 +357,14 @@ midori_web_settings_low_memory_profile ()
mem.dwLength = sizeof (mem);
if (GlobalMemoryStatusEx (&mem))
return mem.ullTotalPhys / 1024 / 1024 < 352;
+#elif defined(__FreeBSD__)
+ size_t size;
+ int mem_total;
+ size = sizeof mem_total;
+
+ sysctlbyname("hw.realmem", &mem_total, &size, NULL, 0);
+
+ return mem_total / 1048576 < 352;
#else
gchar* contents;
const gchar* total;
More information about the Xfce4-commits
mailing list