1.1 --- a/memory/memory_preallocated.cc Sat Mar 27 22:12:12 2021 +0100
1.2 +++ b/memory/memory_preallocated.cc Sun Mar 28 22:38:45 2021 +0200
1.3 @@ -22,6 +22,19 @@
1.4 }
1.5 }
1.6
1.7 +/* Discard all unused regions. */
1.8 +
1.9 +MemoryPreallocated::~MemoryPreallocated()
1.10 +{
1.11 + while (!_regions.empty())
1.12 + {
1.13 + Region *region = _regions.front();
1.14 +
1.15 + _regions.pop_front();
1.16 + _memory->release(region);
1.17 + }
1.18 +}
1.19 +
1.20 /* Obtain an allocated region. */
1.21
1.22 Region *MemoryPreallocated::region()
2.1 --- a/memory/memory_preallocated.h Sat Mar 27 22:12:12 2021 +0100
2.2 +++ b/memory/memory_preallocated.h Sun Mar 28 22:38:45 2021 +0200
2.3 @@ -25,6 +25,8 @@
2.4
2.5 explicit MemoryPreallocated();
2.6
2.7 + virtual ~MemoryPreallocated();
2.8 +
2.9 virtual Region *region();
2.10
2.11 virtual offset_t region_size()