void HYBRIDPlugin_HYBRID::CancelCompute()
{
_computeCanceled = true;
-#ifdef WIN32
-#else
+#if !defined(WIN32) && !defined(__APPLE__)
std::string cmd = "ps xo pid,args | grep " + _genericName;
//cmd += " | grep -e \"^ *[0-9]\\+ \\+" + HYBRIDPlugin_Hypothesis::GetExeName() + "\"";
cmd += " | awk '{print $1}' | xargs kill -9 > /dev/null 2>&1";
//function : DefaultMaximumMemory
//=======================================================================
-#ifndef WIN32
-#include <sys/sysinfo.h>
-#else
+#if defined(WIN32)
#include <windows.h>
+#elif !defined(__APPLE__)
+#include <sys/sysinfo.h>
#endif
double HYBRIDPlugin_Hypothesis::DefaultMaximumMemory()
{
-#ifndef WIN32
- struct sysinfo si;
- int err = sysinfo( &si );
- if ( err == 0 ) {
- int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
- return ( 0.7 * ramMB );
- }
-#else
+#if defined(WIN32)
// See http://msdn.microsoft.com/en-us/library/aa366589.aspx
MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex);
statex.ullTotalVirtual / 1024 / 1024;
return ( 0.7 * totMB );
}
+#elif !defined(__APPLE__)
+ struct sysinfo si;
+ int err = sysinfo( &si );
+ if ( err == 0 ) {
+ int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
+ return ( 0.7 * ramMB );
+ }
#endif
return 1024;
}