All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::CRTMemoryManager Class Reference

#include <MemoryManager.h>

Public Types

typedef shared_ptr< class
- Public Types inherited from G3D::MemoryManager
typedef shared_ptr< class

Public Member Functions

virtual void * alloc (size_t s)
virtual void free (void *ptr)
virtual bool isThreadsafe () const
- Public Member Functions inherited from G3D::ReferenceCountedObject
virtual ~ReferenceCountedObject ()

Static Public Member Functions

static CRTMemoryManager::Ref create ()
- Static Public Member Functions inherited from G3D::MemoryManager
static MemoryManager::Ref create ()

Protected Member Functions

 CRTMemoryManager ()
- Protected Member Functions inherited from G3D::MemoryManager
 MemoryManager ()

Detailed Description

A MemoryManager implemented using the C runtime. Not recommended for general use; this is largely for debugging.

Member Typedef Documentation

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

Constructor & Destructor Documentation

G3D::CRTMemoryManager::CRTMemoryManager ( )
69 {}

+ Here is the caller graph for this function:

Member Function Documentation

void * G3D::CRTMemoryManager::alloc ( size_t  s)

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 from G3D::MemoryManager.

72  {
73  return ::malloc(s);
74 }
CRTMemoryManager::Ref G3D::CRTMemoryManager::create ( )

There's only one instance of this memory manager; it is cached after the first creation.

87  {
89  return m;
90 }
Definition: MemoryManager.cpp:69
shared_ptr< class MemoryManager > Ref
Definition: MemoryManager.h:82

+ Here is the call graph for this function:

void G3D::CRTMemoryManager::free ( void *  ptr)

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 from G3D::MemoryManager.

77  {
78  return ::free(ptr);
79 }
bool G3D::CRTMemoryManager::isThreadsafe ( ) const

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

Reimplemented from G3D::MemoryManager.

82  {
83  return true;
84 }

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