Torque2D Reference
Loading...
Searching...
No Matches
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);
void * alloc(const U32 allocSize) const
Definition frameAllocator.h:181
FrameAllocatorMarker()
Definition frameAllocator.h:171

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()

◆ ~FrameAllocatorMarker()

~FrameAllocatorMarker ( )
inline

Member Function Documentation

◆ alloc()

void * alloc ( const U32 allocSize) const
inline

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