OpenBarnyard
 
Loading...
Searching...
No Matches
TFreeList.h File Reference

Go to the source code of this file.

Classes

class  TFreeList
 
struct  TFreeList::Node
 

Macros

#define TDECLARE_FREELIST_ALLOCATOR(CLASS_NAME)
 
#define TDEFINE_FREELIST_ALLOCATOR(CLASS_NAME)
 
#define TDEFINE_FREELIST_ALLOCATOR1(CLASS_NAME, GROW_SIZE)
 

Macro Definition Documentation

◆ TDECLARE_FREELIST_ALLOCATOR

#define TDECLARE_FREELIST_ALLOCATOR ( CLASS_NAME)
Value:
public: \
TFORCEINLINE void* operator new( size_t s ) { return ms_oFreeList.New( sizeof( CLASS_NAME ) ); } \
TFORCEINLINE void* operator new( size_t s, void* where ) { return where; } \
\
TFORCEINLINE void operator delete( void* ptr ) { ms_oFreeList.Delete( ptr ); } \
TFORCEINLINE void operator delete( void* ptr, void* where ) { delete ptr; } \
\
static void SetupFreeList( TINT a_iCapacity, TINT a_iGrowSize ) \
{ \
ms_oFreeList.SetCapacity( a_iCapacity ); \
ms_oFreeList.SetGrowSize( a_iGrowSize ); \
} \
\
static Toshi::TFreeList ms_oFreeList;
#define TFORCEINLINE
Definition Defines.h:74
int TINT
Definition Typedefs.h:7

Definition at line 3 of file TFreeList.h.

3#define TDECLARE_FREELIST_ALLOCATOR( CLASS_NAME ) \
4public: \
5 TFORCEINLINE void* operator new( size_t s ) { return ms_oFreeList.New( sizeof( CLASS_NAME ) ); } \
6 TFORCEINLINE void* operator new( size_t s, void* where ) { return where; } \
7 \
8 TFORCEINLINE void operator delete( void* ptr ) { ms_oFreeList.Delete( ptr ); } \
9 TFORCEINLINE void operator delete( void* ptr, void* where ) { delete ptr; } \
10 \
11 static void SetupFreeList( TINT a_iCapacity, TINT a_iGrowSize ) \
12 { \
13 ms_oFreeList.SetCapacity( a_iCapacity ); \
14 ms_oFreeList.SetGrowSize( a_iGrowSize ); \
15 } \
16 \
17 static Toshi::TFreeList ms_oFreeList;

◆ TDEFINE_FREELIST_ALLOCATOR

#define TDEFINE_FREELIST_ALLOCATOR ( CLASS_NAME)
Value:
Toshi::TFreeList CLASS_NAME::ms_oFreeList = Toshi::TFreeList( sizeof( CLASS_NAME ), 0, 8, #CLASS_NAME );

Definition at line 19 of file TFreeList.h.

19#define TDEFINE_FREELIST_ALLOCATOR( CLASS_NAME ) \
20 Toshi::TFreeList CLASS_NAME::ms_oFreeList = Toshi::TFreeList( sizeof( CLASS_NAME ), 0, 8, #CLASS_NAME );

◆ TDEFINE_FREELIST_ALLOCATOR1

#define TDEFINE_FREELIST_ALLOCATOR1 ( CLASS_NAME,
GROW_SIZE )
Value:
Toshi::TFreeList CLASS_NAME::ms_oFreeList = Toshi::TFreeList( sizeof( CLASS_NAME ), 0, GROW_SIZE, #CLASS_NAME );

Definition at line 22 of file TFreeList.h.

22#define TDEFINE_FREELIST_ALLOCATOR1( CLASS_NAME, GROW_SIZE ) \
23 Toshi::TFreeList CLASS_NAME::ms_oFreeList = Toshi::TFreeList( sizeof( CLASS_NAME ), 0, GROW_SIZE, #CLASS_NAME );