SetActiveView
This commit is contained in:
@@ -713,6 +713,11 @@ CircularArray<T> MakeCircularArray(Allocator allocator, int size) {
|
||||
|
||||
template <class T>
|
||||
void Add(CircularArray<T> *arr, T item) {
|
||||
if (arr->cap == 0) {
|
||||
arr->allocator = GetSystemAllocator();
|
||||
arr->cap = 128;
|
||||
arr->data = AllocArray(arr->allocator, T, arr->cap);
|
||||
}
|
||||
int idx = arr->write;
|
||||
arr->write = (arr->write + 1) % arr->cap;
|
||||
if (arr->write == 0) arr->buffer_is_full = 1;
|
||||
|
||||
Reference in New Issue
Block a user