Fix snapshot module (#3047)

This commit is contained in:
Dongjia "toka" Zhang 2025-03-06 16:12:05 +01:00 committed by GitHub
parent c0894c40e5
commit 629787771b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,9 +423,9 @@ impl SnapshotModule {
// The heap has grown. so we want to drop those // The heap has grown. so we want to drop those
// we want to align the addresses before calling unmap // we want to align the addresses before calling unmap
// although it is very unlikely that the brk has an unaligned value // although it is very unlikely that the brk has an unaligned value
let new_page_boundary = (new_brk + ((SNAPSHOT_PAGE_MASK - 1) as GuestAddr)) let new_page_boundary = (new_brk + ((SNAPSHOT_PAGE_SIZE - 1) as GuestAddr))
& (!(SNAPSHOT_PAGE_SIZE - 1) as GuestAddr); & (!(SNAPSHOT_PAGE_SIZE - 1) as GuestAddr);
let old_page_boundary = (self.brk + ((SNAPSHOT_PAGE_MASK - 1) as GuestAddr)) let old_page_boundary = (self.brk + ((SNAPSHOT_PAGE_SIZE - 1) as GuestAddr))
& (!(SNAPSHOT_PAGE_SIZE - 1) as GuestAddr); & (!(SNAPSHOT_PAGE_SIZE - 1) as GuestAddr);
if new_page_boundary != old_page_boundary { if new_page_boundary != old_page_boundary {