14#ifndef DELETEDBUFFERCHAIN_H
15#define DELETEDBUFFERCHAIN_H
36#define USE_DELETEDCHAINFLAG 1
39#ifdef USE_DELETEDCHAINFLAG
40enum DeletedChainFlag {
41 DCF_deleted = 0xfeedba0f,
42 DCF_alive = 0x12487654,
58class EXPCL_DTOOL_DTOOLBASE DeletedBufferChain {
60 DeletedBufferChain(
size_t buffer_size);
72#ifdef USE_DELETEDCHAINFLAG
76 TVOLATILE AtomicAdjust::Integer _flag;
86 static INLINE
void *node_to_buffer(ObjectNode *node);
87 static INLINE ObjectNode *buffer_to_node(
void *buffer);
89 ObjectNode *_deleted_chain;
94#ifndef USE_DELETEDCHAINFLAG
96 static const size_t flag_reserved_bytes = 0;
100 static const size_t flag_reserved_bytes =
sizeof(AtomicAdjust::Integer);
103 friend class MemoryHook;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void deallocate(void *ptr, TypeHandle type_handle)
Frees the memory for a buffer previously allocated via allocate().
size_t get_buffer_size() const
Returns the size of the buffer that is actually returned at each request.
void * allocate(size_t size, TypeHandle type_handle)
Allocates the memory for a new buffer of the indicated size (which must be no greater than the fixed ...
bool validate(void *ptr)
Returns true if the pointer is valid, false if it has been deleted or if it was never a valid pointer...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.