15 #ifndef DELETEDBUFFERCHAIN_H
16 #define DELETEDBUFFERCHAIN_H
18 #include "dtoolbase.h"
19 #include "neverFreeMemory.h"
20 #include "mutexImpl.h"
21 #include "atomicAdjust.h"
22 #include "numeric_types.h"
23 #include "typeHandle.h"
38 #define USE_DELETEDCHAINFLAG 1
41 #ifdef USE_DELETEDCHAINFLAG
42 enum DeletedChainFlag {
43 DCF_deleted = 0xfeedba0f,
44 DCF_alive = 0x12487654,
70 void *allocate(
size_t size,
TypeHandle type_handle);
71 void deallocate(
void *ptr,
TypeHandle type_handle);
73 INLINE
bool validate(
void *ptr);
74 INLINE
size_t get_buffer_size()
const;
79 #ifdef USE_DELETEDCHAINFLAG
84 TVOLATILE AtomicAdjust::Integer _flag;
94 static INLINE
void *node_to_buffer(ObjectNode *node);
95 static INLINE ObjectNode *buffer_to_node(
void *buffer);
97 ObjectNode *_deleted_chain;
102 #ifndef USE_DELETEDCHAINFLAG
104 static const size_t flag_reserved_bytes = 0;
106 #elif defined(LINMATH_ALIGN)
108 static const size_t flag_reserved_bytes = 16;
112 static const size_t flag_reserved_bytes =
sizeof(AtomicAdjust::Integer);
113 #endif // USE_DELETEDCHAINFLAG
118 #include "deletedBufferChain.I"
This class provides a wrapper around the various possible malloc schemes Panda might employ...
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...
TypeHandle is the identifier used to differentiate C++ class types.
This template class can be used to provide faster allocation/deallocation for many Panda objects...