MemRegion G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) { guarantee(is_area_committed(start, size_in_pages), "checking"); if (!_special) { os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages)); } _committed.clear_range(start, start + size_in_pages); MemRegion result((HeapWord*)page_start(start), byte_size_for_pages(size_in_pages) / HeapWordSize); return result; }
void G1PageBasedVirtualSpace::uncommit(size_t start_page, size_t size_in_pages) { guarantee(is_area_committed(start_page, size_in_pages), "checking"); size_t end_page = start_page + size_in_pages; if (_special) { // Mark that memory is dirty. If committed again the memory might // need to be cleared explicitly. _dirty.set_range(start_page, end_page); } else { uncommit_internal(start_page, end_page); } _committed.clear_range(start_page, end_page); }