From: Olivier Duchateau Date: Sun, 25 Mar 2012 15:53:45 +0000 (+0200) Subject: Implement low_memory_profile for FreeBSD X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7789bafc68c91c265cbc40f0561a510a7c6cd6de;p=midori Implement low_memory_profile for FreeBSD Fixes: https://bugs.launchpad.net/midori/+bug/963833 --- diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 0bd4e81b..7b13a879 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -26,6 +26,10 @@ #if defined (G_OS_UNIX) #include #endif +#if defined(__FreeBSD__) + #include + #include +#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;