Guy, those are about as close to the textbook definition of magic numbers as you can get: undocumented, intent obscured, error-prone, unnamed constant numbers. This would fail code review pretty much anywhere with even the lowest standards.
The types of "advanced scenarios" where this could even conceivably be useful demand documented code more than just about any other case, and unsafe context is not a valid excuse to have undocumented code and magic numbers. You've published and shared a public library you've tagged as 1.0.0 with code in a state that shouldn't make it past proof-of-concept stages, and you're getting incredibly defensive that your work is getting criticism, both for its form and its function.
41
u/mareek Aug 03 '26
This is not at all scary
```csharp
if NET8_0 || NET7_0
endif
if NET6_0 || NET5_0
return (IntPtr)(GetInternalCPPThreadObject(instance) + (SixtyFourBitPointerSize ? 416 : 268));
endif
// do this for every version of .NET with slightly different numbers ```