Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Integer overflow when core count causes `ProcessorAffinity` bitmask to go above 32-bit capabilities.
  • Loading branch information
jeroldhaas committed Jan 29, 2016
1 parent 2d2738f commit 571b5f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encog-core-cs/Util/Concurrency/DetermineWorkload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public DetermineWorkload(int threads, int workloadSize)
_workloadSize = workloadSize;
if (threads == 0)
{
var num = (int) (Math.Log(((int) Process.GetCurrentProcess().ProcessorAffinity + 1), 2));
var num = (int) (Math.Log(((double) Process.GetCurrentProcess().ProcessorAffinity + 1), 2.0));

// if there is more than one processor, use processor count +1
if (num != 1)
Expand Down

0 comments on commit 571b5f7

Please sign in to comment.