win32: fix page counting in memory manager

This commit is contained in:
Matthew Flatt 2011-04-30 14:01:14 -06:00
parent 68d235378f
commit 6c1ec25016
2 changed files with 2 additions and 8 deletions

View File

@ -18,14 +18,11 @@ inline static void *os_malloc_pages(MMU *mmu, size_t len, size_t alignment, int
if (!dirty_ok)
memset(p, 0, len);
mmu_memory_allocated_inc(mmu, len);
return p;
}
static void os_free_pages(MMU *mmu, void *p, size_t len)
{
mmu_memory_allocated_dec(mmu, len);
sfree(p, len);
}

View File

@ -42,12 +42,10 @@ static void *os_alloc_pages(MMU *mmu, size_t len, size_t alignment, int dirty_ok
}
#endif
mmu_memory_allocated_inc(mmu, len);
/* VirtualAlloc MEM_COMMIT always zeros memory */
return (void *)VirtualAlloc(NULL, len,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE);
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE);
}
static void os_free_pages(MMU *mmu, void *p, size_t len)
@ -69,7 +67,6 @@ static void os_free_pages(MMU *mmu, void *p, size_t len)
}
#endif
mmu_memory_allocated_dec(mmu, len);
VirtualFree(p, 0, MEM_RELEASE);
}