fix vs2017 build

This commit is contained in:
daan 2019-11-02 15:56:21 -07:00
parent fd9d8c85ae
commit ee323aabac
5 changed files with 11 additions and 2 deletions

View File

@ -231,6 +231,7 @@
</ClCompile>
<ClCompile Include="..\..\src\alloc-posix.c" />
<ClCompile Include="..\..\src\alloc.c" />
<ClCompile Include="..\..\src\arena.c" />
<ClCompile Include="..\..\src\heap.c" />
<ClCompile Include="..\..\src\init.c" />
<ClCompile Include="..\..\src\memory.c" />

View File

@ -70,5 +70,8 @@
<ClCompile Include="..\..\src\alloc-posix.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\arena.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -217,6 +217,7 @@
</ClCompile>
<ClCompile Include="..\..\src\alloc-posix.c" />
<ClCompile Include="..\..\src\alloc.c" />
<ClCompile Include="..\..\src\arena.c" />
<ClCompile Include="..\..\src\heap.c" />
<ClCompile Include="..\..\src\init.c" />
<ClCompile Include="..\..\src\memory.c" />

View File

@ -53,6 +53,9 @@
<ClCompile Include="..\..\src\alloc-posix.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\arena.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(ProjectDir)..\..\include\mimalloc.h">

View File

@ -794,6 +794,7 @@ and possibly associated with a specific NUMA node. (use `numa_node>=0`)
static void* mi_os_alloc_huge_os_pagesx(size_t size, int numa_node)
{
mi_assert_internal(size%GiB == 0);
mi_win_enable_large_os_pages();
#if defined(MEM_EXTENDED_PARAMETER_TYPE_BITS)
DWORD flags = MEM_LARGE_PAGES | MEM_COMMIT | MEM_RESERVE;
@ -812,7 +813,7 @@ static void* mi_os_alloc_huge_os_pagesx(size_t size, int numa_node)
params[0].Pointer = &reqs;
params[1].Type = 5; // == MemExtendedParameterAttributeFlags;
params[1].ULong64 = MEM_EXTENDED_PARAMETER_NONPAGED_HUGE;
size_t param_count = 2;
ULONG param_count = 2;
if (numa_node >= 0) {
param_count++;
params[2].Type = MemExtendedParameterNumaNode;
@ -833,7 +834,7 @@ static void* mi_os_alloc_huge_os_pagesx(size_t size, int numa_node)
if (pVirtualAlloc2 != NULL) {
params[0].Type = MemExtendedParameterAddressRequirements;
params[0].Pointer = &reqs;
size_t param_count = 1;
ULONG param_count = 1;
if (numa_node >= 0) {
param_count++;
params[1].Type = MemExtendedParameterNumaNode;