From 2f240acc433cb57a02b225f62d342ec7b11b7ec2 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 25 May 2021 17:30:16 -0700 Subject: [PATCH] increase max job count to 16384 from 4096 the cost is only 2 bytes per job. --- libs/utils/include/utils/JobSystem.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/utils/include/utils/JobSystem.h b/libs/utils/include/utils/JobSystem.h index c9fde5c9dd..31382bad6f 100644 --- a/libs/utils/include/utils/JobSystem.h +++ b/libs/utils/include/utils/JobSystem.h @@ -39,7 +39,7 @@ namespace utils { class JobSystem { - static constexpr size_t MAX_JOB_COUNT = 4096; + static constexpr size_t MAX_JOB_COUNT = 16384; static_assert(MAX_JOB_COUNT <= 0x7FFE, "MAX_JOB_COUNT must be <= 0x7FFE"); using WorkQueue = WorkStealingDequeue; @@ -196,6 +196,7 @@ public: if (job) { new(job->storage) T(std::move(data)); } + assert(job); return job; } @@ -361,6 +362,7 @@ private: void finish(Job* job) noexcept; void put(WorkQueue& workQueue, Job* job) noexcept { + assert(job); size_t index = job - mJobStorageBase; assert(index >= 0 && index < MAX_JOB_COUNT); workQueue.push(uint16_t(index + 1));