Misc: Remove unused code

This commit is contained in:
Connor McLaughlin
2022-08-22 19:55:38 +10:00
parent 43869bf74c
commit 7bbacd2392
100 changed files with 114 additions and 2979 deletions

View File

@ -127,13 +127,8 @@ bool MemoryArena::Create(size_t size, bool writable, bool executable)
#if defined(_WIN32)
const DWORD protect = (writable ? (executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE) : PAGE_READONLY);
#ifndef _UWP
m_file_handle = CreateFileMappingA(INVALID_HANDLE_VALUE, nullptr, protect, Truncate32(size >> 32), Truncate32(size),
file_mapping_name.c_str());
#else
m_file_handle = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, nullptr, protect, size,
StringUtil::UTF8StringToWideString(file_mapping_name).c_str());
#endif
if (!m_file_handle)
{
Log_ErrorPrintf("CreateFileMapping failed: %u", GetLastError());
@ -254,16 +249,8 @@ void* MemoryArena::CreateViewPtr(size_t offset, size_t size, bool writable, bool
void* base_pointer;
#if defined(_WIN32)
const DWORD desired_access = FILE_MAP_READ | (writable ? FILE_MAP_WRITE : 0) | (executable ? FILE_MAP_EXECUTE : 0);
#ifndef _UWP
base_pointer =
MapViewOfFileEx(m_file_handle, desired_access, Truncate32(offset >> 32), Truncate32(offset), size, fixed_address);
#else
// UWP does not support fixed mappings.
if (!fixed_address)
base_pointer = MapViewOfFileFromApp(m_file_handle, desired_access, offset, size);
else
base_pointer = nullptr;
#endif
if (!base_pointer)
return nullptr;
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)