public void CreateClean() { for (int i = 0; i < 100; i++) { using (PinnedBuffer <int> buffer = PinnedBuffer <int> .CreateClean(42)) { for (int j = 0; j < buffer.Length; j++) { Assert.Equal(0, buffer.Array[j]); buffer.Array[j] = 666; } } } }
public void CreateClean() { Parallel.For(0, 100, i => { using (PinnedBuffer <int> buffer = PinnedBuffer <int> .CreateClean(42)) { for (int j = 0; j < buffer.Count; j++) { Assert.Equal(0, buffer.Array[j]); buffer.Array[j] = 666; } } }); }