summaryrefslogtreecommitdiff
path: root/mach-defpager/default_pager.c
diff options
context:
space:
mode:
Diffstat (limited to 'mach-defpager/default_pager.c')
-rw-r--r--mach-defpager/default_pager.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 3fcf9c7d..9935e45d 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1103,19 +1103,10 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
if (INDIRECT_PAGEMAP (new_size))
{
- if (INDIRECT_PAGEMAP_SIZE (new_size) >= vm_page_size)
- /* XXX we know how kalloc.c works; avoid copying. */
- kfree ((char *) round_page ((vm_address_t) pager->map
- + INDIRECT_PAGEMAP_SIZE (new_size)),
- round_page (INDIRECT_PAGEMAP_SIZE (old_size))
- - round_page (INDIRECT_PAGEMAP_SIZE (new_size)));
- else
- {
- const dp_map_t old_mapptr = pager->map;
- pager->map = (dp_map_t) kalloc (INDIRECT_PAGEMAP_SIZE(new_size));
- memcpy (pager->map, old_mapptr, INDIRECT_PAGEMAP_SIZE(new_size));
- kfree ((char *) old_mapptr, INDIRECT_PAGEMAP_SIZE (old_size));
- }
+ const dp_map_t old_mapptr = pager->map;
+ pager->map = (dp_map_t) kalloc (INDIRECT_PAGEMAP_SIZE(new_size));
+ memcpy (pager->map, old_mapptr, INDIRECT_PAGEMAP_SIZE(new_size));
+ kfree ((char *) old_mapptr, INDIRECT_PAGEMAP_SIZE (old_size));
}
else
{