Panda3D
Static Public Member Functions | Static Public Attributes | List of all members
StaticDeletedChain< Type > Class Template Reference

This template class is used to conveniently declare a single instance of the DeletedChain template object, above, for a particular type. More...

#include "deletedChain.h"

Static Public Member Functions

static Type * allocate (size_t size, TypeHandle type_handle)
 
static void deallocate (Type *ptr, TypeHandle type_handle)
 
static bool validate (const Type *ptr)
 

Static Public Attributes

static DeletedChain< Type > _chain
 

Detailed Description

template<class Type>
class StaticDeletedChain< Type >

This template class is used to conveniently declare a single instance of the DeletedChain template object, above, for a particular type.

It relies on the fact that the compiler and linker should unify all references to this static pointer for a given type, as per the C++ spec. However, this sometimes fails; and if the compiler fails to do this, it mostly won't be a big deal; it just means there will be multiple unrelated chains of deleted objects for a particular type. This is only a problem if the code structure causes objects to be allocated from one chain and freed to another, which can lead to leaks.

Definition at line 66 of file deletedChain.h.


The documentation for this class was generated from the following file: