summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-17 10:38:08 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-23 13:46:28 +0100
commitd7446df11d14f2d83d2d3313f918a434373a63e9 (patch)
tree8788ac74317b2680300d5cb901f390bad53d8f12 /src
parent43da08a1e3620cc296d27ef5cdf387693b063c68 (diff)
Add documentation to memory_heap.h
Diffstat (limited to 'src')
-rw-r--r--src/memory_heap.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/memory_heap.h b/src/memory_heap.h
index d90c50c..3f0105a 100644
--- a/src/memory_heap.h
+++ b/src/memory_heap.h
@@ -34,6 +34,12 @@
// is a vector to handle the case when for some reason we need more memory
// than initially anticipated. Instead of throwing errors and giving up, we can
// then at least allocate new memory and just hope for the best.
+//
+// The members add, get, remove correspond to new, dereference, delete. Thus, we
+// first add an object and this gives us and index. With this index we can then
+// retrieve the object until we remove it. As soon as it is removed, you shouldn't
+// use the index anymore to retrieve it (similarly, as you shouldn't use a pointer
+// after calling delete on it).
template <typename T>
class MemoryHeap
{