remove Xbox prefs from PREFSMAN (not tested on Xbox)

This commit is contained in:
Glenn Maynard
2005-10-27 13:24:27 +00:00
parent 2bab32514f
commit 5b51315394
2 changed files with 21 additions and 2 deletions
+20 -1
View File
@@ -4,6 +4,7 @@
#include "global.h" #include "global.h"
#include "VirtualMemory.h" #include "VirtualMemory.h"
#include "RageLog.h" #include "RageLog.h"
#include "Preference.h"
#include <new> #include <new>
#if defined(WINDOWS) #if defined(WINDOWS)
@@ -14,6 +15,16 @@
VirtualMemoryManager vmem_Manager; VirtualMemoryManager vmem_Manager;
static Preference<bool> g_bEnableVirtualMemory( "EnableVirtualMemory", true );
// page file size in megabytes
static Preference<int> g_iPageFileSize( "PageFileSize", 384 );
// page size in kilobytes
static Preference<int> g_iPageSize( "PageSize", 16 );
// threshold in kilobytes where virtual memory will be used
static Preference<int> g_iPageThreshold( "PageThreshold", 8 );
// (under debug) log the virtual memory allocation, etc.
static Preference<bool> g_bLogVirtualMemory( "LogVirtualMemory", false );
struct vm_page struct vm_page
{ {
DWORD startAddress; // start address for this page DWORD startAddress; // start address for this page
@@ -39,8 +50,14 @@ VirtualMemoryManager::~VirtualMemoryManager()
Destroy(); Destroy();
} }
bool VirtualMemoryManager::Init(unsigned long totalPageSize, unsigned long sizePerPage, unsigned long thold) bool VirtualMemoryManager::Init()
{ {
if( !g_bEnableVirtualMemory )
return true;
unsigned long totalPageSize = 1024 * 1024 * g_iPageFileSize;
unsigned long sizePerPage = 1024 * g_iPageSize;
unsigned long thold = 1024 * g_iPageThreshold;
threshold = thold; threshold = thold;
totalPages = totalPageSize / sizePerPage; totalPages = totalPageSize / sizePerPage;
@@ -93,6 +110,8 @@ bool VirtualMemoryManager::Init(unsigned long totalPageSize, unsigned long sizeP
pages[i].locked = false; pages[i].locked = false;
} }
SetLogging( g_bLogVirtualMemory );
inited = true; inited = true;
return true; return true;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ public:
VirtualMemoryManager(); VirtualMemoryManager();
~VirtualMemoryManager(); ~VirtualMemoryManager();
bool Init(unsigned long totalPageSize, unsigned long sizePerPage, unsigned long thold); bool Init();
void Destroy(); void Destroy();
void* Allocate(size_t size); void* Allocate(size_t size);
bool Free(void *ptr); bool Free(void *ptr);