Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvutil::IAllocator Class Reference

An allocator interface. More...

#include <Allocator.h>

Inheritance diagram for nvutil::IAllocator:

Inheritance graph
[legend]
List of all members.

Public Types

typedef Singleton< AllocatortheAllocator
 Convenient typedef. More...


Public Methods

 IAllocator ()
 Default constructor. More...

virtual ~IAllocator ()
 Destructor. More...

NVSG_API void * operator new (size_t size)
 Operator new overload. More...

NVSG_API void * operator new (size_t size, void *p)
 Placement operator new overload. More...

NVSG_API void operator delete (void *p, size_t size)
 Operator delete overload. More...


Detailed Description

An allocator interface.

The IAllocator interface provides overloads of the new and delete operators for heap allocation. This overloads make use of a specialized memory manager, that is highly optimized for small object allocation. For large objects, i.e. objects greater than 128 bytes, the IAllocator interface utilizes the default memory manager.

Note:
Typically a user defined class utilizes this interface through public inheritance.


Member Typedef Documentation

typedef Singleton<Allocator> nvutil::IAllocator::theAllocator
 

Convenient typedef.


Constructor & Destructor Documentation

nvutil::IAllocator::IAllocator   [inline]
 

Default constructor.

Default constructs an IAllocator object.

virtual nvutil::IAllocator::~IAllocator   [inline, virtual]
 

Destructor.


Member Function Documentation

void * nvutil::IAllocator::operator new size_t    size [inline]
 

Operator new overload.

Allocates a memory block of size bytes from heap. Returns start address of allocated memory block.

void * nvutil::IAllocator::operator new size_t    size,
void *    p
[inline]
 

Placement operator new overload.

Provides object creation at a specified memory address.

p must point to a valid block of memory, large enough to hold an object of size bytes.

Return start address of the specified memory block.

void nvutil::IAllocator::operator delete void *    p,
size_t    size
[inline]
 

Operator delete overload.

Frees size bytes of memory at address p.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:44 2005 for NVSGSDK by NVIDIA