summaryrefslogtreecommitdiff
path: root/mach-defpager
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-04-08 09:11:43 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-08 22:21:05 +0200
commit907cbb6676831d950575d097cb4bef3fc5f7d00d (patch)
treeafb27a5f7e7df51f28da61e72bd2b351b3dde4e2 /mach-defpager
parent3b85cd3aacae63f2372ed713e263843824821881 (diff)
Delete fragile hack.
* mach-defpager/default_pager.c (pager_truncate): Do not optimize by using partial kfree.
Diffstat (limited to 'mach-defpager')
-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
{