5 #ifndef _INC_cTempPool_H
6 #define _INC_cTempPool_H
32 static const int k_iCountMax = 16;
48 void* GetTempV(
size_t nLenNeed);
49 void* GetTempV(
size_t nLenNeed,
const void* pData);
51 template<
typename TYPE>
55 return (
TYPE*)(GetTempV((nLenNeed + 1) *
sizeof(
TYPE)));
57 template<
typename TYPE>
61 return (
TYPE*)(GetTempV((nLenNeed + 1) *
sizeof(
TYPE), pData));
65 static void GRAYCALL FreeTempsForThreadManually();
70 return GetTempPool()->GetTempV(nLenNeed,pData);
73 template<
typename TYPE>
78 return GetTempPool()->GetTempT<
TYPE>(nLenNeed);
80 template<
typename TYPE>
85 return GetTempPool()->GetTempT<
TYPE>(nLenNeed, pData);
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define TYPE
Definition: StrT.cpp:38
Definition: cTempPool.h:18
static TYPE *__stdcall GetTempST(StrLen_t nLenNeed, const TYPE *pData)
Definition: cTempPool.h:81
static TYPE *__stdcall GetTempST(StrLen_t nLenNeed)
Definition: cTempPool.h:74
virtual ~cTempPool()
Definition: cTempPool.h:43
static IThreadLocal * sm_pThreadLocal
Allow this to be overloaded with a version that destructs on thread close.
Definition: cTempPool.h:35
static void *__stdcall GetTempSV(size_t nLenNeed, const void *pData)
Definition: cTempPool.h:67
cArrayStruct< cHeapBlock > m_aBlocks
Temporary blocks to be used on a single thread.
Definition: cTempPool.h:30
static cThreadLocalSysNew< cTempPool > sm_ThreadLocalDefault
Definition: cTempPool.h:36
int m_iCountCur
rotate this count to re-use buffers in m_aBlocks.
Definition: cTempPool.h:29
cTempPool()
Definition: cTempPool.h:39
TYPE * GetTempT(StrLen_t nLenNeed)
Definition: cTempPool.h:52
TYPE * GetTempT(StrLen_t nLenNeed, const TYPE *pData)
Definition: cTempPool.h:58
Definition: cThreadLocalSys.h:179
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
Definition: cThreadLocalSys.h:30