| 35 | } |
| 36 | |
| 37 | void initialize_default() |
| 38 | { |
| 39 | constexpr size_t bitmap_bytes = BAN::Math::div_round_up(s_allocator_default_size, s_allocator_chunk_size * 8); |
| 40 | constexpr size_t bitmap_chunks = BAN::Math::div_round_up(bitmap_bytes, s_allocator_chunk_size); |
| 41 | constexpr size_t usable_chunks = s_allocator_default_size / s_allocator_chunk_size - bitmap_chunks; |
| 42 | |
| 43 | this->bitmap_chunks = bitmap_chunks; |
| 44 | this->total_chunks = usable_chunks; |
| 45 | this->free_chunks = usable_chunks; |
| 46 | this->base = s_default_allocator_memory; |
| 47 | |
| 48 | memset(this->base, 0, bitmap_chunks * s_allocator_chunk_size); |
| 49 | } |
| 50 | |
| 51 | bool initialize_dynamic() |
| 52 | { |
no test coverage detected