summaryrefslogtreecommitdiff
path: root/src/memory_heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory_heap.h')
-rw-r--r--src/memory_heap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/memory_heap.h b/src/memory_heap.h
index 3f0105a..658598c 100644
--- a/src/memory_heap.h
+++ b/src/memory_heap.h
@@ -61,6 +61,7 @@ public:
T& get(Index index);
const T& get(Index index) const;
void remove(Index index);
+ void clear();
private:
std::vector<T> memory;
@@ -119,3 +120,10 @@ void MemoryHeap<T>::remove(Index index)
{
free_indices.push_back(index);
}
+
+template <typename T>
+void MemoryHeap<T>::clear()
+{
+ memory.clear();
+ free_indices.clear();
+}