The MSDN documentation for Interlocked.Increment
states:
This method handles an overflow condition by wrapping: if location = Int32.MaxValue, location + 1 = Int32.MinValue. No exception is thrown.
What does “location + 1” mean in this context? If Increment
alters the memory location next to the location field, isn't this likely to lead to corruption in the .NET runtime, given that this adjacent location could be anything (object references, class metadata, etc)?