virtual const c8* getTextFromClipboard() const = 0;\r
\r
//! Get the total and available system RAM\r
- /** \param totalBytes: will contain the total system memory in bytes\r
- \param availableBytes: will contain the available memory in bytes\r
+ /** \param totalBytes: will contain the total system memory in Kilobytes (1024 B)\r
+ \param availableBytes: will contain the available memory in Kilobytes (1024 B)\r
\return True if successful, false if not */\r
virtual bool getSystemMemory(u32* totalBytes, u32* availableBytes) const = 0;\r
\r
*Avail = (u32)(MemoryStatusEx.ullAvailPhys>>10);\r
return true;\r
\r
-#elif defined(_IRR_POSIX_API_) && !defined(__FreeBSD__)\r
-#if defined(_SC_PHYS_PAGES) && defined(_SC_AVPHYS_PAGES)\r
+#elif defined(_IRR_POSIX_API_) && defined(_SC_PHYS_PAGES) && defined(_SC_AVPHYS_PAGES)\r
long ps = sysconf(_SC_PAGESIZE);\r
long pp = sysconf(_SC_PHYS_PAGES);\r
long ap = sysconf(_SC_AVPHYS_PAGES);\r
\r
- if ((ps==-1)||(pp==-1)||(ap==-1))\r
+ if (ps == -1 || (Total && pp == -1) || (Avail && ap == -1))\r
return false;\r
\r
if (Total)\r
- *Total = (u32)((ps*(long long)pp)>>10);\r
+ *Total = (u32)((pp>>10)*ps);\r
if (Avail)\r
- *Avail = (u32)((ps*(long long)ap)>>10);\r
+ *Avail = (u32)((ap>>10)*ps);\r
return true;\r
-#else\r
- // TODO: implement for non-availability of symbols/features\r
- return false;\r
-#endif\r
#elif defined(_IRR_OSX_PLATFORM_)\r
int mib[2];\r
int64_t physical_memory;\r
mib[1] = HW_MEMSIZE;\r
length = sizeof(int64_t);\r
sysctl(mib, 2, &physical_memory, &length, NULL, 0);\r
+\r
+ if (Total)\r
+ *Total = (u32)(physical_memory>>10);\r
+ if (Avail)\r
+ *Avail = (u32)(physical_memory>>10); // we don't know better\r
return true;\r
#else\r
// TODO: implement for others\r