Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regions_mm: Determine size of the mapped memory region before unmapping
The memory block allocated by the allocator may be larger than a requested one. If the allocated block size exceeds the memory page size, only enough pages are mapped to satisfy the request. Thanks to this optimization, it don't map memory pages that will not be used. When freeing memory, the allocator knows only size of the allocated block. Information about the number of pages actually mapped isn't stored anywhere. Before unmapping memory, determine the number of mapped pages to avoid error when trying to unmap unmapped memory. Signed-off-by: Adrian Warecki <[email protected]>
- Loading branch information