[Memory] Close shared memory FD and properly handle its invalid value
This commit is contained in:
@@ -113,11 +113,11 @@ Memory::~Memory() {
|
||||
heaps_.physical.Dispose();
|
||||
|
||||
// Unmap all views and close mapping.
|
||||
if (mapping_) {
|
||||
if (mapping_ != xe::memory::kFileMappingHandleInvalid) {
|
||||
UnmapViews();
|
||||
xe::memory::CloseFileMappingHandle(mapping_, file_name_);
|
||||
mapping_base_ = nullptr;
|
||||
mapping_ = nullptr;
|
||||
mapping_ = xe::memory::kFileMappingHandleInvalid;
|
||||
}
|
||||
|
||||
virtual_membase_ = nullptr;
|
||||
@@ -133,9 +133,9 @@ bool Memory::Initialize() {
|
||||
file_name_,
|
||||
// entire 4gb space + 512mb physical:
|
||||
0x11FFFFFFF, xe::memory::PageAccess::kReadWrite, false);
|
||||
if (!mapping_) {
|
||||
if (mapping_ == xe::memory::kFileMappingHandleInvalid) {
|
||||
XELOGE("Unable to reserve the 4gb guest address space.");
|
||||
assert_not_null(mapping_);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user