From 3eb7e8d5a8b75a645d9994152451ce213e164887 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Jul 2024 09:43:59 +0200 Subject: zz --- src/handle-page.hpp | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 src/handle-page.hpp (limited to 'src/handle-page.hpp') diff --git a/src/handle-page.hpp b/src/handle-page.hpp deleted file mode 100644 index 7afad5f8..00000000 --- a/src/handle-page.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once -#include "handle-fwd.hpp" -#include "compat/defs.hpp" -#include -#include - -namespace floormat::impl_handle { - -template -struct Item -{ - fm_DECLARE_DELETED_COPY_MOVE_ASSIGNMENTS(Item); - Item(); - ~Item() noexcept; - - union { char empty = {}; Obj object; }; - Handle handle; - uint32_t next; -}; - -template -class Page -{ - friend struct Handle; - - std::array, PageSize> storage; - BitArray used_map; // todo replace with a rewrite of std::bitset - uint32_t start_index; - uint32_t used_count; - uint32_t first_free; - bool locked; - - static void do_deallocate(Item& item); - -public: - fm_DECLARE_DELETED_COPY_MOVE_ASSIGNMENTS(Page); - - explicit Page(uint32_t start_index); - ~Page() noexcept; - - template - requires requires (Xs&&... xs) { - Obj{forward(xs)...}; - } - [[nodiscard]] Item& allocate(Xs&&... xs); - void deallocate(Handle obj); - void deallocate_all(); - bool is_empty(); - bool is_full(); - uint32_t use_count() const; -}; - -} // namespace floormat::impl_handle -- cgit v1.2.3