| 70 | } |
| 71 | |
| 72 | sugoi_chunk_view_t sugoi_storage_t::allocate_view_strict(sugoi_group_t* group, EIndex count) |
| 73 | { |
| 74 | sugoi_chunk_t* freeChunk = nullptr; |
| 75 | for (auto i = group->firstFree; i < (uint32_t)group->chunks.size(); ++i) |
| 76 | { |
| 77 | auto chunk = group->chunks[i]; |
| 78 | if (chunk->count + count <= chunk->get_capacity()) |
| 79 | { |
| 80 | freeChunk = chunk; |
| 81 | break; |
| 82 | } |
| 83 | } |
| 84 | if (freeChunk == nullptr) |
| 85 | freeChunk = group->new_chunk(count); |
| 86 | EIndex start = freeChunk->count; |
| 87 | group->resize_chunk(freeChunk, start + count); |
| 88 | structural_change(group, freeChunk); |
| 89 | return { freeChunk, start, count }; |
| 90 | } |
| 91 | |
| 92 | void sugoi_storage_t::destroy(const sugoi_chunk_view_t& view) |
| 93 | { |
nothing calls this directly
no test coverage detected