Big simplification and improvement of the entity collection system, reducing unneeded steps for packages

This commit is contained in:
gingerBill
2021-07-27 20:45:50 +01:00
parent 116e98b378
commit 9cd5ea59dd
7 changed files with 355 additions and 298 deletions

View File

@@ -64,6 +64,10 @@ void mpmc_destroy(MPMCQueue<T> *q) {
template <typename T>
isize mpmc_enqueue(MPMCQueue<T> *q, T const &data) {
if (q->mask == 0) {
return -1;
}
isize head_idx = q->head_idx.load(std::memory_order_relaxed);
for (;;) {
@@ -101,9 +105,12 @@ isize mpmc_enqueue(MPMCQueue<T> *q, T const &data) {
}
}
template <typename T>
bool mpmc_dequeue(MPMCQueue<T> *q, T *data_) {
if (q->mask == 0) {
return false;
}
isize tail_idx = q->tail_idx.load(std::memory_order_relaxed);
for (;;) {