XII Release 0.1.0
Loading...
Searching...
No Matches
xiiAllocationPolicyStack< OverwriteMemoryOnFree > Class Template Reference

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <AllocationPolicyStack.h>

Public Types

enum  { Alignment = 16 }

Public Member Functions

XII_FORCE_INLINE xiiAllocationPolicyStack (xiiAllocator *pParent)
XII_FORCE_INLINE void SetMaxAllocationSize (xiiUInt32 uiSize)
 Sets the maximum allocation size that can be handled by this stack allocator. Allocations larger than this size will be directly allocated from the parent allocator.
XII_FORCE_INLINE void * Allocate (size_t uiSize, size_t uiAlign)
XII_FORCE_INLINE void Deallocate (void *pPtr)
XII_ALWAYS_INLINE xiiAllocator * GetParent () const

Detailed Description

template<bool OverwriteMemoryOnFree = false>
class xiiAllocationPolicyStack< OverwriteMemoryOnFree >

Copyright (c) Theophilus Eriata. All Rights Reserved.

This policy implements a stack allocator. It is designed for scenarios where you have a lot of short-lived allocations that are freed in a LIFO order, but it also supports freeing in arbitrary order (at the cost of some fragmentation).

For debugging purposes, the policy can also overwrite all freed memory with 0xCDCDCDCD to make it easier to find use-after-free situations.

See also
xiiAllocatorWithPolicy

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