MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / allocate

Method allocate

modules/engine/runtime/src/ecs/storage.cpp:41–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void sugoi_storage_t::allocate(sugoi_group_t* group, EIndex count, sugoi_view_callback_t callback, void* u)
42{
43 using namespace sugoi;
44 if (scheduler)
45 {
46 SKR_ASSERT(scheduler->is_main_thread(this));
47 scheduler->sync_archetype(group->archetype);
48 }
49 while (count != 0)
50 {
51 sugoi_chunk_view_t v = allocate_view(group, count);
52 entities.fill_entities(v);
53 construct_view(v);
54 count -= v.count;
55 if (callback)
56 callback(u, &v);
57 }
58}
59
60sugoi_chunk_view_t sugoi_storage_t::allocate_view(sugoi_group_t* group, EIndex count)
61{

Callers 2

sugoiS_allocate_typeFunction · 0.45
sugoiS_allocate_groupFunction · 0.45

Calls 4

construct_viewFunction · 0.85
is_main_threadMethod · 0.80
sync_archetypeMethod · 0.80
fill_entitiesMethod · 0.80

Tested by

no test coverage detected