BepuPhysics/BodyLayoutOptimizer.cs
/// <summary>
/// Because new claims are appended, and a failed claim always results in the removal of a contiguous set of trailing indices, it acts like a stack.
/// This pops off a number of the most recent claim indices.
/// </summary>
/// <param name="workerClaimsToPop">Number of claims to remove from the end of the worker claims list.</param>
Because new claims are appended, and a failed claim always results in the removal of a contiguous set of trailing indices, it acts like a stack.
This pops off a number of the most recent claim indices.
Because new claims are appended and a failed claim always results in the removal of a contiguous set of trailing indices it acts like a stack . This pops off a number of the most recent claim indices .
public void Unclaim(int workerClaimsToPop)
            {
                Debug.Assert(workerClaimsToPop <= WorkerClaims.Count, "The pop request should never exceed the accumulated claims.");
                for (int i = 0; i < workerClaimsToPop; ++i)
                {
                    WorkerClaims.Pop(out var poppedIndex);
                    ClaimStates[poppedIndex] = 0;
                }
            }
public void Unclaim ( int workerClaimsToPop ) { Debug . Assert ( workerClaimsToPop <= WorkerClaims . Count , " " ) ; for ( int i = 0 ; i < workerClaimsToPop ; ++ i ) { WorkerClaims . Pop ( out var poppedIndex ) ; ClaimStates [ poppedIndex ] = 0 ; } }
Because new claims are appended, and a failed claim always results in the removal of a contiguous set of trailing indices, it acts like a stack.
Because new claims are appended and a failed claim always results in the removal of a contiguous set of trailing indices it acts like a stack .
//We don't need to do anything special here, provided a reasonably strong memory model. Just release the slot.
workerClaimsToPop
int
Number of claims to remove from the end of the worker claims list.
Number of claims to remove from the end of the worker claims list .