Skip to content

Commit

Permalink
Fix detection of VirtualAllocFromApp availability (#102)
Browse files Browse the repository at this point in the history
Fixes #101.
  • Loading branch information
Guekka authored Mar 8, 2021
1 parent a2d990c commit e7a0103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/virtual_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const std::size_t foonathan::memory::virtual_memory_page_size = get_page_size();
void* foonathan::memory::virtual_memory_reserve(std::size_t no_pages) noexcept
{
auto pages =
#if (_MSC_VER <= 1900)
#if (_MSC_VER <= 1900) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
VirtualAlloc(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE, PAGE_READWRITE);
#else
VirtualAllocFromApp(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE,
Expand All @@ -55,7 +55,7 @@ void foonathan::memory::virtual_memory_release(void* pages, std::size_t) noexcep
void* foonathan::memory::virtual_memory_commit(void* memory, std::size_t no_pages) noexcept
{
auto region =
#if (_MSC_VER <= 1900)
#if (_MSC_VER <= 1900) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
VirtualAlloc(memory, no_pages * virtual_memory_page_size, MEM_COMMIT, PAGE_READWRITE);
#else
VirtualAllocFromApp(memory, no_pages * virtual_memory_page_size, MEM_COMMIT,
Expand Down

0 comments on commit e7a0103

Please sign in to comment.