Torque2D Reference
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
FrameAllocatorMarker Class Reference

#include <frameAllocator.h>

Public Member Functions

 FrameAllocatorMarker ()
 
 ~FrameAllocatorMarker ()
 
void * alloc (const U32 allocSize) const
 

Detailed Description

Helper class to deal with FrameAllocator usage.

The purpose of this class is to make it simpler and more reliable to use the FrameAllocator. Simply use it like this:

char *buff = (char*)mem.alloc(100);

When you leave the scope you defined the FrameAllocatorMarker in, it will automatically restore the watermark on the FrameAllocator. In situations with complex branches, this can be a significant headache remover, as you don't have to remember to reset the FrameAllocator on every posssible branch.

Constructor & Destructor Documentation

~FrameAllocatorMarker ( )
inline

Member Function Documentation

void* alloc ( const U32  allocSize) const
inline

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