diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-13 19:01:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-14 13:04:42 +0200 |
commit | 3e4a66786b4cd1b4c691d91f27cb6fdf920fe586 (patch) | |
tree | 52e188f09afb0d81d857df4bc2f335eb42230c6d /src/handle-page.hpp | |
parent | 1250fc680050848d777bbb37aa294ad5cff20436 (diff) |
w
Diffstat (limited to 'src/handle-page.hpp')
-rw-r--r-- | src/handle-page.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/handle-page.hpp b/src/handle-page.hpp index bf7ecdad..7afad5f8 100644 --- a/src/handle-page.hpp +++ b/src/handle-page.hpp @@ -9,7 +9,10 @@ namespace floormat::impl_handle { template<typename Obj, uint32_t PageSize> struct Item { + fm_DECLARE_DELETED_COPY_MOVE_ASSIGNMENTS(Item); + Item(); ~Item() noexcept; + union { char empty = {}; Obj object; }; Handle<Obj, PageSize> handle; uint32_t next; @@ -23,8 +26,9 @@ class Page std::array<Item<Obj, PageSize>, PageSize> storage; BitArray used_map; // todo replace with a rewrite of std::bitset uint32_t start_index; - uint32_t used_count = 0; - uint32_t first_free = (uint32_t)-1; + uint32_t used_count; + uint32_t first_free; + bool locked; static void do_deallocate(Item<Obj, PageSize>& item); @@ -43,6 +47,7 @@ public: void deallocate_all(); bool is_empty(); bool is_full(); + uint32_t use_count() const; }; } // namespace floormat::impl_handle |