summaryrefslogtreecommitdiff
path: root/mach-defpager
diff options
context:
space:
mode:
Diffstat (limited to 'mach-defpager')
-rw-r--r--mach-defpager/default_pager.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 5a83f437..5780322e 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -894,7 +894,8 @@ pager_extend(pager, new_size)
old_size = pager->size;
if (new_size <= atop(max_doubled_size)) {
- i = old_size;
+ /* New size cannot be less than 1 */
+ i = old_size ? old_size : 1;
while (i < new_size)
i <<= 1;
new_size = i;
@@ -1115,9 +1116,6 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
}
}
- if (new_size == 0)
- new_size = 1;
-
if (! INDIRECT_PAGEMAP(old_size))
{
/* First deallocate pages in the truncated region. */