aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/tier1/mempool.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2014-05-15 13:59:18 -0700
committerJoe Ludwig <[email protected]>2014-05-15 13:59:18 -0700
commit53e78c503e6e9c7d15e2eefc480755fe37dd7077 (patch)
treec8cc106eb4c0a2b2b5d79f534f2facb0514f5f55 /mp/src/public/tier1/mempool.h
parentAdded many shader source files (diff)
downloadsource-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.tar.xz
source-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.zip
General:
* Upgraded Steamworks SDK to v1.29 * Fixed mod compatibility problem with Multiplayer Base that was introduced in September. * In Hammer, while using the Vertex Tool, pressing CTRL+B will snap selected vertices to the grid. Virtual Reality: * Mods that support virtual reality now need to have a line in gameinfo.txt that says “supportsvr 1”. This indicates to gameui and engine that certain UI should be enabled. * VR-enabled mods will now start up in VR mode when launched from Steam’s VR mode. Windows: * Upgraded to Visual Studio 2013. If you need to build projects for VS 2010, add /2010 to your VPC command line. OSX: * Upgraded to XCode 5.
Diffstat (limited to 'mp/src/public/tier1/mempool.h')
-rw-r--r--mp/src/public/tier1/mempool.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/mp/src/public/tier1/mempool.h b/mp/src/public/tier1/mempool.h
index 88406fbf..01d3a33f 100644
--- a/mp/src/public/tier1/mempool.h
+++ b/mp/src/public/tier1/mempool.h
@@ -30,19 +30,27 @@
typedef void (*MemoryPoolReportFunc_t)( PRINTF_FORMAT_STRING char const* pMsg, ... );
+// Ways a memory pool can grow when it needs to make a new blob:
+enum MemoryPoolGrowType_t
+{
+ UTLMEMORYPOOL_GROW_NONE=0, // Don't allow new blobs.
+ UTLMEMORYPOOL_GROW_FAST=1, // New blob size is numElements * (i+1) (ie: the blocks it allocates
+ // get larger and larger each time it allocates one).
+ UTLMEMORYPOOL_GROW_SLOW=2 // New blob size is numElements.
+};
+
class CUtlMemoryPool
{
public:
- // Ways the memory pool can grow when it needs to make a new blob.
+ // !KLUDGE! For legacy code support, import the global enum into this scope
enum MemoryPoolGrowType_t
{
- GROW_NONE=0, // Don't allow new blobs.
- GROW_FAST=1, // New blob size is numElements * (i+1) (ie: the blocks it allocates
- // get larger and larger each time it allocates one).
- GROW_SLOW=2 // New blob size is numElements.
+ GROW_NONE=UTLMEMORYPOOL_GROW_NONE,
+ GROW_FAST=UTLMEMORYPOOL_GROW_FAST,
+ GROW_SLOW=UTLMEMORYPOOL_GROW_SLOW
};
- CUtlMemoryPool( int blockSize, int numElements, int growMode = GROW_FAST, const char *pszAllocOwner = NULL, int nAlignment = 0 );
+ CUtlMemoryPool( int blockSize, int numElements, int growMode = UTLMEMORYPOOL_GROW_FAST, const char *pszAllocOwner = NULL, int nAlignment = 0 );
~CUtlMemoryPool();
void* Alloc(); // Allocate the element size you specified in the constructor.
@@ -103,7 +111,7 @@ protected:
class CMemoryPoolMT : public CUtlMemoryPool
{
public:
- CMemoryPoolMT(int blockSize, int numElements, int growMode = GROW_FAST, const char *pszAllocOwner = NULL) : CUtlMemoryPool( blockSize, numElements, growMode, pszAllocOwner) {}
+ CMemoryPoolMT(int blockSize, int numElements, int growMode = UTLMEMORYPOOL_GROW_FAST, const char *pszAllocOwner = NULL) : CUtlMemoryPool( blockSize, numElements, growMode, pszAllocOwner) {}
void* Alloc() { AUTO_LOCK( m_mutex ); return CUtlMemoryPool::Alloc(); }