mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
Merge pull request #2162 from degasus/prefetch_tex
CustomTexture: prefetch all available textures
This commit is contained in:
commit
a6412fb41e
10 changed files with 210 additions and 14 deletions
|
@ -19,6 +19,12 @@
|
|||
#else
|
||||
#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef __APPLE__
|
||||
#include <sys/sysctl.h>
|
||||
#else
|
||||
#include <sys/sysinfo.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Valgrind doesn't support MAP_32BIT.
|
||||
|
@ -241,3 +247,26 @@ std::string MemUsage()
|
|||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
size_t MemPhysical()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MEMORYSTATUSEX memInfo;
|
||||
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&memInfo);
|
||||
return memInfo.ullTotalPhys;
|
||||
#elif defined(__APPLE__)
|
||||
int mib[2];
|
||||
size_t physical_memory;
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_MEMSIZE;
|
||||
size_t length = sizeof(size_t);
|
||||
sysctl(mib, 2, &physical_memory, &length, NULL, 0);
|
||||
return physical_memory;
|
||||
#else
|
||||
struct sysinfo memInfo;
|
||||
sysinfo (&memInfo);
|
||||
return (size_t)memInfo.totalram * memInfo.mem_unit;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue