Move resizing the page_protections before resizing the cache to avoid a needless
resize operation that has to be undone and may fail when doing so. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42332 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4761,10 +4761,6 @@ vm_resize_area(area_id areaID, size_t newSize, bool kernel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// shrinking the cache can't fail, so we do it now
|
|
||||||
if (status == B_OK && newSize < oldSize)
|
|
||||||
status = cache->Resize(cache->virtual_base + newSize, priority);
|
|
||||||
|
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
// Shrink or grow individual page protections if in use.
|
// Shrink or grow individual page protections if in use.
|
||||||
if (area->page_protections != NULL) {
|
if (area->page_protections != NULL) {
|
||||||
@@ -4792,6 +4788,10 @@ vm_resize_area(area_id areaID, size_t newSize, bool kernel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shrinking the cache can't fail, so we do it now
|
||||||
|
if (status == B_OK && newSize < oldSize)
|
||||||
|
status = cache->Resize(cache->virtual_base + newSize, priority);
|
||||||
|
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
// Something failed -- resize the areas back to their original size.
|
// Something failed -- resize the areas back to their original size.
|
||||||
// This can fail, too, in which case we're seriously screwed.
|
// This can fail, too, in which case we're seriously screwed.
|
||||||
|
|||||||
Reference in New Issue
Block a user