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

◆ GetByteCount()

static unsafe nuint System.Runtime.InteropServices.NativeMemory.GetByteCount ( nuint elementCount,
nuint elementSize )
inlinestaticprivate

Definition at line 22 of file NativeMemory.cs.

23 {
24 nuint num = (nuint)((nint)1 << 4 * sizeof(UIntPtr));
25 if ((elementSize < num && elementCount < num) || elementSize == 0 || (nuint)UIntPtr.MaxValue / elementSize >= elementCount)
26 {
27 return elementCount * elementSize;
28 }
29 return UIntPtr.MaxValue;
30 }

References System.UIntPtr.MaxValue.

Referenced by System.Runtime.InteropServices.NativeMemory.Alloc().