-added EntityBlocks allocating in blocks (no memory freeing, currently block contain 128 EntityBlocks)
This commit is contained in:
parent
1aa1fbf36b
commit
5b2a6e9890
3 changed files with 20 additions and 48 deletions
|
|
@ -14,6 +14,7 @@ import ecs.entity;
|
|||
import ecs.vector;
|
||||
import ecs.hash_map;
|
||||
import ecs.id_manager;
|
||||
import ecs.entity_allocator;
|
||||
|
||||
alias gEM = EntityManager.instance;
|
||||
|
||||
|
|
@ -441,8 +442,7 @@ class EntityManager
|
|||
{
|
||||
if (block is null)
|
||||
{
|
||||
block = cast(EntitiesBlock*) AlignedMallocator.instance.alignedAllocate(page_size,
|
||||
page_size);
|
||||
block = cast(EntitiesBlock*) allocator.getBlock();//AlignedMallocator.instance.alignedAllocate(page_size, page_size);
|
||||
*block = EntitiesBlock(info);
|
||||
if (previous_block is null)
|
||||
{
|
||||
|
|
@ -619,6 +619,7 @@ class EntityManager
|
|||
enum pages_in_block = 128;
|
||||
|
||||
IDManager id_manager;
|
||||
EntityAllocator allocator;
|
||||
|
||||
HashMap!(ushort[], EntityInfo*) entities_infos;
|
||||
HashMap!(string, uint) components_map;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue