mm: allow us to re-claim a page

If a page is already claimed by us, don't throw an OutOfMemory error.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-12-24 09:36:09 +08:00
parent 8521093f6d
commit 649d1ba26b

View File

@ -118,7 +118,7 @@ impl MemoryManager {
if page > tbl.len() { if page > tbl.len() {
return Err(XousError::BadAddress); return Err(XousError::BadAddress);
} }
if tbl[page] != 0 { if tbl[page] != 0 && tbl[page] != pid {
return Err(XousError::OutOfMemory); return Err(XousError::OutOfMemory);
} }
tbl[page] = pid; tbl[page] = pid;