Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/virtual_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ 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)
VirtualAlloc(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE, PAGE_READWRITE);
#else
VirtualAllocFromApp(nullptr, no_pages * virtual_memory_page_size, MEM_RESERVE, PAGE_READWRITE);
#endif
return pages;
}

Expand All @@ -51,7 +55,11 @@ void* foonathan::memory::virtual_memory_commit(void* memory,
std::size_t no_pages) noexcept
{
auto region =
#if (_MSC_VER <= 1900)
VirtualAlloc(memory, no_pages * virtual_memory_page_size, MEM_COMMIT, PAGE_READWRITE);
#else
VirtualAllocFromApp(memory, no_pages * virtual_memory_page_size, MEM_COMMIT, PAGE_READWRITE);
#endif
if (!region)
return nullptr;
FOONATHAN_MEMORY_ASSERT(region == memory);
Expand Down
2 changes: 1 addition & 1 deletion tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
add_executable(foonathan_memory_node_size_debugger test_types.hpp node_size_debugger.hpp node_size_debugger.cpp)
if (CMAKE_CROSSCOMPILING)
# statically link when cross compiling so emulator doesn't need library paths
set_target_properties(foonathan_memory_node_size_debugger PROPERTIES LINK_FLAGS "-static")
set_target_properties(foonathan_memory_node_size_debugger PROPERTIES LINK_FLAGS "/WHOLEARCHIVE")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks cross-compiling in Linux

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed by the commit I've referenced below, please check and open an issue if it doesn't work.

endif()
if (MSVC)
target_compile_options(foonathan_memory_node_size_debugger PRIVATE "/bigobj")
Expand Down