diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /external/vpc/public/tier0/memvirt.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'external/vpc/public/tier0/memvirt.h')
| -rw-r--r-- | external/vpc/public/tier0/memvirt.h | 46 |
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 |