Skip to content

Commit 4ed9b4f

Browse files
committed
Fix crash on systems with many CPUs
1 parent 13c454f commit 4ed9b4f

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

AVS_SplitProcess/AVS_SplitProcess.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -28,27 +28,27 @@
2828
<ConfigurationType>DynamicLibrary</ConfigurationType>
2929
<UseDebugLibraries>true</UseDebugLibraries>
3030
<CharacterSet>MultiByte</CharacterSet>
31-
<PlatformToolset>v100</PlatformToolset>
31+
<PlatformToolset>v141</PlatformToolset>
3232
</PropertyGroup>
3333
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
3434
<ConfigurationType>DynamicLibrary</ConfigurationType>
3535
<UseDebugLibraries>true</UseDebugLibraries>
3636
<CharacterSet>MultiByte</CharacterSet>
37-
<PlatformToolset>v100</PlatformToolset>
37+
<PlatformToolset>v141</PlatformToolset>
3838
</PropertyGroup>
3939
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4040
<ConfigurationType>DynamicLibrary</ConfigurationType>
4141
<UseDebugLibraries>false</UseDebugLibraries>
4242
<WholeProgramOptimization>true</WholeProgramOptimization>
4343
<CharacterSet>MultiByte</CharacterSet>
44-
<PlatformToolset>v100</PlatformToolset>
44+
<PlatformToolset>v141</PlatformToolset>
4545
</PropertyGroup>
4646
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4747
<ConfigurationType>DynamicLibrary</ConfigurationType>
4848
<UseDebugLibraries>false</UseDebugLibraries>
4949
<WholeProgramOptimization>true</WholeProgramOptimization>
5050
<CharacterSet>MultiByte</CharacterSet>
51-
<PlatformToolset>v100</PlatformToolset>
51+
<PlatformToolset>v141</PlatformToolset>
5252
</PropertyGroup>
5353
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5454
<ImportGroup Label="ExtensionSettings">

AVS_SplitProcess/MP_Pipeline.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ int get_cpu_arrangement(int* arrangement)
438438
}
439439
}
440440
auto ptr = buffer;
441-
while (buffer_size >= sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION))
441+
while (buffer_size >= sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION) && cpu_group_count < MAX_CPU)
442442
{
443443
if (ptr->Relationship == RelationProcessorCore)
444444
{

AVS_SplitProcess/MP_Pipeline.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
static const char* SCRIPT_SPLITTER_PATTERN = "^(\\s*### ###\\s*)$";
88

99
// for use with SetThreadAffinityMask
10-
// limit to 32 for compatibility with 32bit OSes
11-
static const int MAX_CPU = 32;
10+
static const int MAX_CPU = 64;
1211

1312
typedef struct _cpu_arrangement_info_t
1413
{

SplitProcess_Slave/SplitProcess_Slave.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -28,27 +28,27 @@
2828
<ConfigurationType>Application</ConfigurationType>
2929
<UseDebugLibraries>true</UseDebugLibraries>
3030
<CharacterSet>MultiByte</CharacterSet>
31-
<PlatformToolset>v100</PlatformToolset>
31+
<PlatformToolset>v141</PlatformToolset>
3232
</PropertyGroup>
3333
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
3434
<ConfigurationType>Application</ConfigurationType>
3535
<UseDebugLibraries>true</UseDebugLibraries>
3636
<CharacterSet>MultiByte</CharacterSet>
37-
<PlatformToolset>v100</PlatformToolset>
37+
<PlatformToolset>v141</PlatformToolset>
3838
</PropertyGroup>
3939
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4040
<ConfigurationType>Application</ConfigurationType>
4141
<UseDebugLibraries>false</UseDebugLibraries>
4242
<WholeProgramOptimization>true</WholeProgramOptimization>
4343
<CharacterSet>MultiByte</CharacterSet>
44-
<PlatformToolset>v100</PlatformToolset>
44+
<PlatformToolset>v141</PlatformToolset>
4545
</PropertyGroup>
4646
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4747
<ConfigurationType>Application</ConfigurationType>
4848
<UseDebugLibraries>false</UseDebugLibraries>
4949
<WholeProgramOptimization>true</WholeProgramOptimization>
5050
<CharacterSet>MultiByte</CharacterSet>
51-
<PlatformToolset>v100</PlatformToolset>
51+
<PlatformToolset>v141</PlatformToolset>
5252
</PropertyGroup>
5353
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5454
<ImportGroup Label="ExtensionSettings">

0 commit comments

Comments
 (0)