Refactor job system to use type-safe pooled job data
Replaces unsafe pointer-based job data with JobDataPool<T> and ConcurrentSlotMap<T> for safer, type-safe management. JobInfo now references job data by (dataID, dataGeneration). JobExecutor and JobScheduler updated to use the new pool-based approach, requiring T : struct. Removed FreeList and pointer logic. WorkerThread now uses reference counting to prevent use-after-free. Updated all scheduling APIs and benchmarks to match new signatures. Improved documentation and inlining. Bumped assembly version to 3.0.0 due to breaking changes.
This commit is contained in:
@@ -249,6 +249,11 @@ public unsafe struct FreeList : IMemoryAllocator<FreeList, FreeList.CreationOpti
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private readonly void DrainRemoteFrees(ThreadCache* cache)
|
||||
{
|
||||
if (Volatile.Read(ref cache->remoteFreeHead) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var head = (FreeNode*)Interlocked.Exchange(ref cache->remoteFreeHead, 0);
|
||||
while (head != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user