Better multithread jobs generation tests
This commit is contained in:
parent
3e7575c4b2
commit
ffc19d4723
2 changed files with 47 additions and 10 deletions
|
|
@ -1496,7 +1496,7 @@ export struct EntityManager
|
|||
{
|
||||
int reamaining_entities = (entities_per_job - entities_count - (
|
||||
first_block.entities_count - first_elem));
|
||||
|
||||
|
||||
//if first block don't fill job
|
||||
if (reamaining_entities > 0)
|
||||
{
|
||||
|
|
@ -1510,7 +1510,8 @@ export struct EntityManager
|
|||
if (full_blocks_count * info.max_entities + entities_count + (
|
||||
first_block.entities_count - first_elem) >= entities_per_job)
|
||||
{
|
||||
assert(entities_per_job == full_blocks_count * info.max_entities + entities_count + (first_block.entities_count - first_elem));
|
||||
assert(entities_per_job == full_blocks_count * info.max_entities + entities_count + (
|
||||
first_block.entities_count - first_elem));
|
||||
CallData data = CallData(caller.system_id, sys,
|
||||
info, sys.m_update_delegate, first_block,
|
||||
cast(ushort)(full_blocks_count + 1),
|
||||
|
|
@ -1535,7 +1536,7 @@ export struct EntityManager
|
|||
first_elem = last_elem;
|
||||
blocks_count -= full_blocks_count + 1;
|
||||
first_block = block;
|
||||
if(last_elem == block.entities_count)
|
||||
if (last_elem == block.entities_count)
|
||||
{
|
||||
assert(block.next_block == null);
|
||||
first_block = null;
|
||||
|
|
@ -1553,7 +1554,7 @@ export struct EntityManager
|
|||
first_elem += last_elem;
|
||||
assert(first_elem <= first_block.entities_count);
|
||||
//if job takes every entity, take next block
|
||||
if(first_elem == first_block.entities_count)
|
||||
if (first_elem == first_block.entities_count)
|
||||
{
|
||||
first_elem = 0;
|
||||
first_block = first_block.next_block;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue