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

Method free

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

Source from the content-addressed store, hash-verified

111}
112
113void sugoi_storage_t::free(const sugoi_chunk_view_t& view)
114{
115 using namespace sugoi;
116 auto group = view.chunk->group;
117 structural_change(group, view.chunk);
118 uint32_t toMove = std::min(view.count, view.chunk->count - (view.start + view.count));
119 if (toMove > 0)
120 {
121 sugoi_chunk_view_t dstView{ view.chunk, view.start, toMove };
122 EIndex srcIndex = view.chunk->count - toMove;
123 entities.move_entities(dstView, srcIndex);
124 move_view(dstView, srcIndex);
125 }
126 group->resize_chunk(view.chunk, view.chunk->count - view.count);
127}
128
129void sugoi_storage_t::structural_change(sugoi_group_t* group, sugoi_chunk_t* chunk)
130{

Callers

nothing calls this directly

Calls 4

move_viewFunction · 0.85
move_entitiesMethod · 0.80
resize_chunkMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected