We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f511b3e commit ee3e368Copy full SHA for ee3e368
src/DotNext/Buffers/SpanOwner.cs
@@ -126,7 +126,9 @@ static unsafe Span<T> Allocate(int length)
126
}
127
else
128
{
129
- var byteCount = checked((uint)Unsafe.SizeOf<T>() * (nuint)(uint)length);
+ var x = (uint)Unsafe.SizeOf<T>();
130
+ var y = (nuint)(uint)length;
131
+ var byteCount = checked(x * y);
132
ptr = NativeMemory.AlignedAlloc(byteCount, (uint)Intrinsics.AlignOf<T>());
133
134
0 commit comments