@@ -19,7 +19,8 @@ namespace ember::allocators {
1919
2020template <std::size_t _size, std::size_t _elements>
2121class StaticAllocator final {
22- static constexpr std::string_view tag { " asio_static" };
22+ static constexpr std::string_view default_tag { " static_allocator" };
23+ static constexpr std::string_view block_tag { " static_allocator_block" };
2324
2425 struct alignas (std::max_align_t ) AlignedStorage {
2526 std::byte storage[_size];
@@ -31,7 +32,7 @@ class StaticAllocator final {
3132 >;
3233
3334 class SlabAllocator {
34- static constexpr std::string_view tag { " asio_static_slab " };
35+ static constexpr std::string_view tag { " static_slab_allocator " };
3536 static constexpr std::size_t slab_size = BlockAllocator<>::block_size * _elements;
3637
3738 alignas (std::max_align_t ) std::array<std::byte, slab_size> storage;
@@ -73,22 +74,22 @@ class StaticAllocator final {
7374 };
7475
7576 BlockAllocator<SlabAllocator> allocator;
77+ std::string_view tag;
7678
7779public:
78- StaticAllocator ()
79- : allocator(_elements, tag) {
80- ALLOC_TRACK (tag, mem_rep_create);
81- }
82-
83- StaticAllocator (std::string_view tag)
84- : allocator(_elements, tag) {
80+ StaticAllocator (std::string_view tag = default_tag)
81+ : allocator(_elements, block_tag)
82+ , tag(tag) {
8583 ALLOC_TRACK (tag, mem_rep_create);
8684 }
8785
8886 ~StaticAllocator () {
8987 ALLOC_TRACK (tag, mem_rep_destroy);
9088 }
9189
90+ StaticAllocator (const StaticAllocator&) = delete ;
91+ StaticAllocator& operator =(const StaticAllocator&) = delete ;
92+
9293 void * allocate (std::size_t size) {
9394 ALLOC_TRACK (tag, mem_rep_bytes_alloc, size);
9495
0 commit comments