Fix address-marking bugs

* Non-blocksize-aligned regions could fail to be found. Have the
  bootloader load them aligned.
* Consolidating used frame blocks in the bootstrap means these would
  have been impossible to free as address space
* mark_permanent wasn't actually removing blocks from the free list
This commit is contained in:
Justin C. Miller
2019-03-03 01:38:07 -08:00
parent 28cf5562ac
commit 194527e0fe
4 changed files with 15 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ namespace kutil {
using address_manager =
buddy_allocator<
16, // Min allocation: 64KiB
12, // Min allocation: 4KiB
36 // Max allocation: 64GiB
>;

View File

@@ -132,6 +132,7 @@ public:
for (unsigned i = size_max; i >= size_min; --i) {
for (auto *r : free_bucket(i)) {
if (start >= r->address && end <= r->end()) {
free_bucket(i).remove(r);
delete_region(r, start, end);
return;
}