From c2f914ddfa09f8fa1b2f93eb264b536ac6a85699 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Sat, 10 Nov 2018 19:32:51 +0100 Subject: support zero-alloc + fix --- src/structures/pl_list.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/structures/pl_list.hpp') diff --git a/src/structures/pl_list.hpp b/src/structures/pl_list.hpp index 327e259..0cbd233 100644 --- a/src/structures/pl_list.hpp +++ b/src/structures/pl_list.hpp @@ -73,6 +73,9 @@ public: pl_list(std::size_t capacity = 0); ~pl_list(); + struct external_storage_policy {}; + pl_list(pl_cell *cells, std::size_t ncells, external_storage_policy); + pl_list(const pl_list &other); pl_list &operator=(const pl_list &other); @@ -117,8 +120,10 @@ private: pl_cell *free_; // value-less cell which terminates the linked list pl_basic_cell endcell_; + // whether cell storage is allocated + bool cells_allocd_; - void initialize(std::size_t capacity); + void initialize(std::size_t capacity, pl_cell *extcells = NULL); pl_cell *allocate(pl_cell *pos); void deallocate(pl_cell *cell); }; -- cgit v1.2.3