IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
mem_allocator_forward.hxx
Go to the documentation of this file.
1
3
4#pragma once
6
7namespace ice
8{
9
18
20 {
22 ice::Allocator& backing_allocator,
23 ice::ForwardAllocatorParams params = { },
24 std::source_location = std::source_location::current()
25 ) noexcept;
26
28 ice::Allocator& backing_allocator,
29 std::string_view name,
30 ice::ForwardAllocatorParams params = { },
31 std::source_location = std::source_location::current()
32 ) noexcept;
33
35
37 void reset() noexcept;
38
39 protected:
40 struct MemoryBucket;
41
42 auto do_allocate(ice::AllocRequest request) noexcept -> ice::AllocResult override;
43 void do_deallocate(void* pointer) noexcept override;
44
45 private:
46 ice::Allocator& _backing_alloc;
47 ice::ForwardAllocatorParams const _params;
48
49 MemoryBucket* _buckets;
50 };
51
52} // namespace ice
SPDX-License-Identifier: MIT.
Definition array.hxx:12
std::uint32_t u32
Definition types.hxx:26
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition mem_types.hxx:25
Definition mem.hxx:16
Definition mem.hxx:44
ForwardAllocator(ice::Allocator &backing_allocator, std::string_view name, ice::ForwardAllocatorParams params={ }, std::source_location=std::source_location::current()) noexcept
void do_deallocate(void *pointer) noexcept override
ForwardAllocator(ice::Allocator &backing_allocator, ice::ForwardAllocatorParams params={ }, std::source_location=std::source_location::current()) noexcept
void reset() noexcept
Releases all memory blocks not in-use.
auto do_allocate(ice::AllocRequest request) noexcept -> ice::AllocResult override
~ForwardAllocator() noexcept
Definition mem_allocator_forward.hxx:11
ice::usize bucket_size
The size of a single memory block.
Definition mem_allocator_forward.hxx:13
ice::u32 min_bucket_count
The number of empty buckets allocated.
Definition mem_allocator_forward.hxx:16
Represents a unsigned size value on the given platform.
Definition mem_size_types.hxx:26