27template<u
int SYNCPOINTS>
42 Threading::Event*
End();
47 Threading::Event
ev[SYNCPOINTS];
73template<u
int SYNCPOINTS>
80 this->
events.Resize(SYNCPOINTS);
81 this->
states.Resize(SYNCPOINTS);
83 for (
uint i = 0; i < SYNCPOINTS; i++)
99template<u
int SYNCPOINTS>
109template<u
int SYNCPOINTS>
120 Threading::Event&
ev = this->
events[i];
121 if (
ev.Peek() && this->freeInterval.lower)
134template<u
int SYNCPOINTS>
141 if (end > this->size && this->
freeInterval.lower >= this->freeInterval.upper)
151 n_warning(
"Over-allocated RingAllocator!\n");
152 alloc.
data =
nullptr;
170template<u
int SYNCPOINTS>
171inline Threading::Event*
174 Threading::Event* ret =
nullptr;
Util::FixedArray< SyncState > states
Definition ringallocator.h:63
Threading::Event ev[SYNCPOINTS]
Definition ringallocator.h:47
Util::FixedArray< Interval > lockedIntervals
Definition ringallocator.h:61
SyncState
Definition ringallocator.h:55
@ Waiting
Definition ringallocator.h:57
@ Reset
Definition ringallocator.h:58
@ Signaled
Definition ringallocator.h:56
Threading::Event * End()
end allocation phase, insert sync points
Definition ringallocator.h:172
uint currentAllocation
Definition ringallocator.h:66
RingAllocator(const SizeT size)
constructor
Definition ringallocator.h:75
bool Allocate(const SizeT size, RingAlloc &alloc)
allocate memory
Definition ringallocator.h:136
uint nextEvent
Definition ringallocator.h:67
uint size
Definition ringallocator.h:46
byte * buffer
Definition ringallocator.h:45
Interval currentInterval
Definition ringallocator.h:64
void Start()
start allocation phase, checks sync points and unlocks regions if they have been signaled
Definition ringallocator.h:111
~RingAllocator()
destructor
Definition ringallocator.h:101
Util::FixedArray< Threading::Event > events
Definition ringallocator.h:62
Interval freeInterval
Definition ringallocator.h:65
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
void __cdecl n_warning(const char *msg,...)
This function is called when a warning should be issued which doesn't require abortion of the applica...
Definition debug.cc:161
#define n_assert(exp)
Definition debug.h:50
Definition arenaallocator.h:31
Definition ringallocator.h:22
byte * data
Definition ringallocator.h:24
uint offset
Definition ringallocator.h:23
Definition ringallocator.h:50
uint lower
Definition ringallocator.h:51
uint upper
Definition ringallocator.h:51
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48