summaryrefslogtreecommitdiff
path: root/src/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.cpp')
-rw-r--r--src/memory.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/memory.cpp b/src/memory.cpp
index 775b30a..21780f2 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -94,3 +94,14 @@ void pke::EndTransientBucket(pke::MemBucket *bkt) {
bucketHead--;
}
}
+
+void pke::Flush() {
+ for (long i = bucketHead - 2; i > -1; --i) {
+ if (buckets[i].head != 0) break;
+ if (buckets[i+1].head != 0) break;
+ if (buckets[i].transient == true) break;
+ if (buckets[i+1].transient == true) break;
+ bucketHead--;
+ DestroyBucket(&buckets[i + 1]);
+ }
+}