|
Nebula
|
#include <ringallocator.h>
Allocates memory up-front, and then allows other systems to grab regions.
Synchronizes used regions between frames (thread safe) in order to recycle previously occupied memory.
Classes | |
| struct | Interval |
Public Member Functions | |
| RingAllocator (const SizeT size) | |
| constructor | |
| ~RingAllocator () | |
| destructor | |
| void | Start () |
| start allocation phase, checks sync points and unlocks regions if they have been signaled | |
| bool | Allocate (const SizeT size, RingAlloc &alloc) |
| allocate memory | |
| Threading::Event * | End () |
| end allocation phase, insert sync points | |
Private Types | |
| enum | SyncState { Signaled , Waiting , Reset } |
Private Attributes | |
| byte * | buffer |
| uint | size |
| Threading::Event | ev [SYNCPOINTS] |
| Util::FixedArray< Interval > | lockedIntervals |
| Util::FixedArray< Threading::Event > | events |
| Util::FixedArray< SyncState > | states |
| Interval | currentInterval |
| Interval | freeInterval |
| uint | currentAllocation |
| uint | nextEvent |
|
private |
|
inline |
constructor
|
inline |
destructor
|
inline |
allocate memory
|
inline |
end allocation phase, insert sync points
|
inline |
start allocation phase, checks sync points and unlocks regions if they have been signaled
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |