Create benchmarks updated. Global benchmark setup & cleanup added.
This commit is contained in:
1 parent
4bfb40007a
commit
cc364c5fd7
7 files changed
+38
-24
No files matched your search
@@ -70,6 +70,11 @@ namespace Recyclable.Collections
|
||||
|
||||
private static RecyclableArrayList<T[]> SetupMemoryBlocks(RecyclableList<T> owner, int blockSize, long? totalItemsCount)
|
||||
{
|
||||
if (blockSize <= 0)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
totalItemsCount ??= 8 * blockSize;
|
||||
int additionalArray = totalItemsCount % blockSize > 0 ? 1 : 0;
|
||||
int memoryBlockCount = (int)(totalItemsCount.Value / blockSize).LimitTo(int.MaxValue) + additionalArray;
|
||||
|
||||
Reference in new issue
Block a user