Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
G3D::MemoryManager Class Reference

Abstraction of memory management. More...

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::AlignedMemoryManager, G3D::AreaMemoryManager, and G3D::CRTMemoryManager.

Public Types

typedef shared_ptr< class
MemoryManager
Ref
 

Public Member Functions

virtual voidalloc (size_t s)
 Return a pointer to s bytes of memory that are unused by the rest of the program.
 
virtual void free (void *ptr)
 Invoke to declare that this memory will no longer be used by the program.
 
virtual bool isThreadsafe () const
 Returns true if this memory manager is threadsafe (i.e., alloc and free can be called asychronously)
 

Static Public Member Functions

static MemoryManager::Ref create ()
 Return the instance.
 

Protected Member Functions

 MemoryManager ()
 

Detailed Description

Abstraction of memory management.

Default implementation uses G3D::System::malloc and is threadsafe.

See Also
LargePoolMemoryManager, CRTMemoryManager, AlignedMemoryManager, AreaMemoryManager

Member Typedef Documentation

typedef shared_ptr<class MemoryManager> G3D::MemoryManager::Ref

Constructor & Destructor Documentation

G3D::MemoryManager::MemoryManager ( )
protected

Member Function Documentation

virtual void* G3D::MemoryManager::alloc ( size_t  s)
virtual

Return a pointer to s bytes of memory that are unused by the rest of the program.

The contents of the memory are undefined

Reimplemented in G3D::CRTMemoryManager, G3D::AreaMemoryManager, and G3D::AlignedMemoryManager.

static MemoryManager::Ref G3D::MemoryManager::create ( )
static

Return the instance.

There's only one instance of the default MemoryManager; it is cached after the first creation.

Referenced by G3D::Array< PreprocessedShaderSource >::Array(), G3D::categorizeByDerivedType(), and G3D::Table< std::string, DependencyList >::Table().

virtual void G3D::MemoryManager::free ( void ptr)
virtual

Invoke to declare that this memory will no longer be used by the program.

The memory manager is not required to actually reuse or release this memory.

Reimplemented in G3D::CRTMemoryManager, G3D::AreaMemoryManager, and G3D::AlignedMemoryManager.

virtual bool G3D::MemoryManager::isThreadsafe ( ) const
virtual

Returns true if this memory manager is threadsafe (i.e., alloc and free can be called asychronously)

Reimplemented in G3D::CRTMemoryManager, G3D::AreaMemoryManager, and G3D::AlignedMemoryManager.


documentation generated on Sat Jan 12 2013 22:49:56 using doxygen 1.8.2