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 859cf32 commit 6231f78Copy full SHA for 6231f78
src/DotNext/Sentinel.cs
@@ -1,7 +1,13 @@
1
+using System.Runtime.InteropServices;
2
+
3
namespace DotNext;
4
5
internal static class Sentinel
6
{
7
// instance has fixed address in memory which is critical to ValueReference implementation
- internal static readonly object Instance = GC.AllocateUninitializedArray<byte>(length: 0, pinned: true);
8
+ internal static readonly object Instance = GC.AllocateUninitializedArray<Dummy>(length: 0, pinned: true);
9
10
+ // The struct is needed to avoid false positives caused by the type check on the variable that stores singleton
11
+ [StructLayout(LayoutKind.Auto)]
12
+ private struct Dummy;
13
}
0 commit comments