aboutsummaryrefslogtreecommitdiff
path: root/src/structures/pl_list.hpp
diff options
context:
space:
mode:
authorJP Cimalando <jpcima@users.noreply.github.com>2018-11-10 19:32:51 +0100
committerJP Cimalando <jpcima@users.noreply.github.com>2018-11-10 19:32:51 +0100
commitc2f914ddfa09f8fa1b2f93eb264b536ac6a85699 (patch)
tree9200417e4998015b7a718852bcc0b78ae1314d0c /src/structures/pl_list.hpp
parent63ae4b909946eca9be11f2c5b0f0dc08ae706597 (diff)
downloadlibADLMIDI-c2f914ddfa09f8fa1b2f93eb264b536ac6a85699.tar.gz
libADLMIDI-c2f914ddfa09f8fa1b2f93eb264b536ac6a85699.tar.bz2
libADLMIDI-c2f914ddfa09f8fa1b2f93eb264b536ac6a85699.zip
support zero-alloc + fix
Diffstat (limited to 'src/structures/pl_list.hpp')
-rw-r--r--src/structures/pl_list.hpp7
1 files changed, 6 insertions, 1 deletions
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<T> *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<T> *free_;
// value-less cell which terminates the linked list
pl_basic_cell<T> endcell_;
+ // whether cell storage is allocated
+ bool cells_allocd_;
- void initialize(std::size_t capacity);
+ void initialize(std::size_t capacity, pl_cell<T> *extcells = NULL);
pl_cell<T> *allocate(pl_cell<T> *pos);
void deallocate(pl_cell<T> *cell);
};