9 template<
typename DataType>
13 Allocator(uint64_t totalBytes, uint64_t threadCount, uint64_t typeSize)
33 ASSERT(threadId <
m_threadCount,
"ThreadId specified should be smaller than thread count.");
48 return (DataType*)
ret;
uint64_t m_totalBytes
Definition: allocator.h:53
void Init()
Definition: allocator.h:30
Definition: allocator.h:10
#define ASSERT(condition,...)
Definition: assert.h:27
bool ret
Definition: stmskip.cc:242
void Uninit()
Definition: allocator.h:39
#define __sync_fetch_and_add(p, a)
Definition: icc-sync.hpp:57
static __thread char * m_base
Definition: allocator.h:58
~Allocator()
Definition: allocator.h:24
static __thread uint64_t m_freeIndex
Definition: allocator.h:59
DataType * Alloc()
Definition: allocator.h:42
uint64_t m_threadCount
Definition: allocator.h:54
uint64_t m_typeSize
Definition: allocator.h:56
uint64_t m_ticket
Definition: allocator.h:55
Allocator(uint64_t totalBytes, uint64_t threadCount, uint64_t typeSize)
Definition: allocator.h:13
char * m_pool
Definition: allocator.h:52