public override T this[int key] { get { if (key < minIndex || key > maxIndex) { return(null); } return(Volatile.Read(ref arrayData[key - minIndex])); } }
public override T this[int key] { get { if (key < minIndex || key > maxIndex) { return(null); } #if NET45PLUS return(Volatile.Read(ref arrayData[key - minIndex])); #else return(Interlocked.CompareExchange(ref arrayData[key - minIndex], null, null)); #endif } }
public static unsafe Object LoadReferenceTypeField(IntPtr address) { return(Volatile.Read <Object>(ref Unsafe.As <IntPtr, Object>(ref *(IntPtr *)address))); }
public static unsafe void StoreReferenceTypeField(IntPtr address, Object fieldValue) { Volatile.Write <Object>(ref Unsafe.As <IntPtr, Object>(ref *(IntPtr *)address), fieldValue); }