Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetNewTableSize()

static int System.Threading.ThreadLocal< T >.GetNewTableSize ( int minSize)
inlinestaticprivate

Definition at line 442 of file ThreadLocal.cs.

443 {
444 if ((uint)minSize > Array.MaxLength)
445 {
446 return int.MaxValue;
447 }
448 int num = minSize;
449 num--;
450 num |= num >> 1;
451 num |= num >> 2;
452 num |= num >> 4;
453 num |= num >> 8;
454 num |= num >> 16;
455 num++;
456 if ((uint)num > Array.MaxLength)
457 {
458 num = Array.MaxLength;
459 }
460 return num;
461 }

References System.Array.MaxLength.

Referenced by System.Threading.ThreadLocal< T >.GrowTable(), and System.Threading.ThreadLocal< T >.SetValueSlow().