MCPcopy Create free account
hub / github.com/MariaDB/server / my_getphysmem

Function my_getphysmem

plugin/feedback/utils.cc:222–242  ·  view source on GitHub ↗

return the amount of physical memory */

Source from the content-addressed store, hash-verified

220 return the amount of physical memory
221*/
222static ulonglong my_getphysmem()
223{
224#ifdef _WIN32
225 MEMORYSTATUSEX memstatus;
226 memstatus.dwLength= sizeof(memstatus);
227 GlobalMemoryStatusEx(&memstatus);
228 return memstatus.ullTotalPhys;
229#else
230 ulonglong pages= 0;
231
232#ifdef _SC_PHYS_PAGES
233 pages= sysconf(_SC_PHYS_PAGES);
234#endif
235
236#ifdef _SC_PAGESIZE
237 return pages * sysconf(_SC_PAGESIZE);
238#else
239 return pages * my_getpagesize();
240#endif
241#endif
242}
243
244/* get the number of (online) CPUs */
245int my_getncpus()

Callers 1

fill_misc_dataFunction · 0.85

Calls 1

my_getpagesizeFunction · 0.85

Tested by

no test coverage detected