ezEngine  Milestone 7
ezMemoryPolicies::ezStackAllocation Class Reference

This allocation policy works like a stack. You can only "push" and "pop" allocations in the correct order. More...

#include <StackAllocation.h>

Classes

struct  Bucket
 

Public Types

enum  { Alignment = sizeof(void*) }
 

Public Member Functions

EZ_FORCE_INLINE ezStackAllocation (ezAllocatorBase *pParent)
 
EZ_FORCE_INLINE void SetNextBucketSize (ezUInt32 uiSize)
 
EZ_FORCE_INLINE void * Allocate (size_t uiSize, size_t uiAlign)
 
EZ_FORCE_INLINE void Deallocate (void *ptr)
 
EZ_FORCE_INLINE void Reset ()
 
EZ_FORCE_INLINE ezAllocatorBaseGetParent () const
 

Private Attributes

ezAllocatorBasem_pParent
 
ezUInt32 m_uiCurrentBucketIndex
 
ezUInt32 m_uiCurrentBucketSize
 
ezArrayPtr< ezUInt8 > m_currentBucket
 
ezUInt8 * m_pNextAllocation
 
ezHybridArray< Bucket, 4 > m_buckets
 

Detailed Description

This allocation policy works like a stack. You can only "push" and "pop" allocations in the correct order.

Note
It is also possible to free all allocations at once.
See Also
ezAllocator

Class Documentation

struct ezMemoryPolicies::ezStackAllocation::Bucket
Class Members
ezArrayPtr< ezUInt8 > memory
ezUInt8 * pLastAllocation

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