fix: kernel and desktop bug fixes
This commit is contained in:
@@ -143,6 +143,17 @@ namespace Memory {
|
||||
return;
|
||||
}
|
||||
|
||||
// Overlap check: the new region must end at or before `current` starts.
|
||||
// The previous double-free guards only matched single-page overlaps;
|
||||
// freeing a multi-page span that overlaps the start of an existing
|
||||
// block would silently corrupt the free list.
|
||||
if (current != nullptr && addr + size > (uint64_t)current) {
|
||||
Kt::KernelLogStream(Kt::WARNING, "PFA")
|
||||
<< "Overlapping free at " << addr << " size " << size << ", ignoring";
|
||||
Lock.Release();
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to coalesce with previous block (if prev ends where new block starts)
|
||||
bool merged_prev = false;
|
||||
if (prev != &head) {
|
||||
|
||||
Reference in New Issue
Block a user