C#: Fix crash on machines/VMs with 1 hardware thread (#134)
This commit is contained in:
@@ -205,7 +205,7 @@ namespace Il2CppInspector.Outputs
|
|||||||
var results = new ConcurrentBag<Dictionary<TypeInfo, StringBuilder>>();
|
var results = new ConcurrentBag<Dictionary<TypeInfo, StringBuilder>>();
|
||||||
|
|
||||||
// Generate each type
|
// Generate each type
|
||||||
Parallel.ForEach(types, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount / 2 },
|
Parallel.ForEach(types, new ParallelOptions { MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 1) },
|
||||||
() => new Dictionary<TypeInfo, StringBuilder>(),
|
() => new Dictionary<TypeInfo, StringBuilder>(),
|
||||||
(type, _, dict) => {
|
(type, _, dict) => {
|
||||||
// Skip namespace and any children if requested
|
// Skip namespace and any children if requested
|
||||||
|
|||||||
Reference in New Issue
Block a user