summaryrefslogtreecommitdiff
path: root/external/vpc/public/tier0/memvirt.h
diff options
context:
space:
mode:
Diffstat (limited to 'external/vpc/public/tier0/memvirt.h')
-rw-r--r--external/vpc/public/tier0/memvirt.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/external/vpc/public/tier0/memvirt.h b/external/vpc/public/tier0/memvirt.h
new file mode 100644
index 0000000..eeb0996
--- /dev/null
+++ b/external/vpc/public/tier0/memvirt.h
@@ -0,0 +1,46 @@
+//========== Copyright (C) Valve Corporation, All rights reserved. ==========//
+//
+// Purpose: CVirtualMemoryManager interface
+//
+//===========================================================================//
+
+#ifndef MEM_VIRT_H
+#define MEM_VIRT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#define VMM_KB ( 1024 )
+#define VMM_MB ( 1024 * VMM_KB )
+
+#ifdef _PS3
+// Total virtual address space reserved by CVirtualMemoryManager on startup:
+#define VMM_VIRTUAL_SIZE ( 512 * VMM_MB )
+#define VMM_PAGE_SIZE ( 64 * VMM_KB )
+#endif
+
+
+
+// Allocate virtual sections via IMemAlloc::AllocateVirtualMemorySection
+abstract_class IVirtualMemorySection
+{
+public:
+ // Information about memory section
+ virtual void * GetBaseAddress() = 0;
+ virtual size_t GetPageSize() = 0;
+ virtual size_t GetTotalSize() = 0;
+
+ // Functions to manage physical memory mapped to virtual memory
+ virtual bool CommitPages( void *pvBase, size_t numBytes ) = 0;
+ virtual void DecommitPages( void *pvBase, size_t numBytes ) = 0;
+
+ // Release the physical memory and associated virtual address space
+ virtual void Release() = 0;
+};
+
+// Get the IVirtualMemorySection associated with a given memory address (if any):
+extern IVirtualMemorySection *GetMemorySectionForAddress( void *pAddress );
+
+
+#endif // MEM_VIRT_H