fix vs2017 build
This commit is contained in:
parent
fd9d8c85ae
commit
ee323aabac
@ -231,6 +231,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\alloc-posix.c" />
|
<ClCompile Include="..\..\src\alloc-posix.c" />
|
||||||
<ClCompile Include="..\..\src\alloc.c" />
|
<ClCompile Include="..\..\src\alloc.c" />
|
||||||
|
<ClCompile Include="..\..\src\arena.c" />
|
||||||
<ClCompile Include="..\..\src\heap.c" />
|
<ClCompile Include="..\..\src\heap.c" />
|
||||||
<ClCompile Include="..\..\src\init.c" />
|
<ClCompile Include="..\..\src\init.c" />
|
||||||
<ClCompile Include="..\..\src\memory.c" />
|
<ClCompile Include="..\..\src\memory.c" />
|
||||||
|
@ -70,5 +70,8 @@
|
|||||||
<ClCompile Include="..\..\src\alloc-posix.c">
|
<ClCompile Include="..\..\src\alloc-posix.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\arena.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -217,6 +217,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\alloc-posix.c" />
|
<ClCompile Include="..\..\src\alloc-posix.c" />
|
||||||
<ClCompile Include="..\..\src\alloc.c" />
|
<ClCompile Include="..\..\src\alloc.c" />
|
||||||
|
<ClCompile Include="..\..\src\arena.c" />
|
||||||
<ClCompile Include="..\..\src\heap.c" />
|
<ClCompile Include="..\..\src\heap.c" />
|
||||||
<ClCompile Include="..\..\src\init.c" />
|
<ClCompile Include="..\..\src\init.c" />
|
||||||
<ClCompile Include="..\..\src\memory.c" />
|
<ClCompile Include="..\..\src\memory.c" />
|
||||||
|
@ -53,6 +53,9 @@
|
|||||||
<ClCompile Include="..\..\src\alloc-posix.c">
|
<ClCompile Include="..\..\src\alloc-posix.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\arena.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="$(ProjectDir)..\..\include\mimalloc.h">
|
<ClInclude Include="$(ProjectDir)..\..\include\mimalloc.h">
|
||||||
|
5
src/os.c
5
src/os.c
@ -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)
|
static void* mi_os_alloc_huge_os_pagesx(size_t size, int numa_node)
|
||||||
{
|
{
|
||||||
mi_assert_internal(size%GiB == 0);
|
mi_assert_internal(size%GiB == 0);
|
||||||
|
mi_win_enable_large_os_pages();
|
||||||
|
|
||||||
#if defined(MEM_EXTENDED_PARAMETER_TYPE_BITS)
|
#if defined(MEM_EXTENDED_PARAMETER_TYPE_BITS)
|
||||||
DWORD flags = MEM_LARGE_PAGES | MEM_COMMIT | MEM_RESERVE;
|
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[0].Pointer = &reqs;
|
||||||
params[1].Type = 5; // == MemExtendedParameterAttributeFlags;
|
params[1].Type = 5; // == MemExtendedParameterAttributeFlags;
|
||||||
params[1].ULong64 = MEM_EXTENDED_PARAMETER_NONPAGED_HUGE;
|
params[1].ULong64 = MEM_EXTENDED_PARAMETER_NONPAGED_HUGE;
|
||||||
size_t param_count = 2;
|
ULONG param_count = 2;
|
||||||
if (numa_node >= 0) {
|
if (numa_node >= 0) {
|
||||||
param_count++;
|
param_count++;
|
||||||
params[2].Type = MemExtendedParameterNumaNode;
|
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) {
|
if (pVirtualAlloc2 != NULL) {
|
||||||
params[0].Type = MemExtendedParameterAddressRequirements;
|
params[0].Type = MemExtendedParameterAddressRequirements;
|
||||||
params[0].Pointer = &reqs;
|
params[0].Pointer = &reqs;
|
||||||
size_t param_count = 1;
|
ULONG param_count = 1;
|
||||||
if (numa_node >= 0) {
|
if (numa_node >= 0) {
|
||||||
param_count++;
|
param_count++;
|
||||||
params[1].Type = MemExtendedParameterNumaNode;
|
params[1].Type = MemExtendedParameterNumaNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user