Browse Source

Minor cleanup

pull/3040/head
James Jackson-South 9 months ago
parent
commit
55818d39d6
  1. 3
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs

3
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs

@ -319,7 +319,6 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
// additional unmanaged handles. Therefore the only invariant we can reliably assert here is // additional unmanaged handles. Therefore the only invariant we can reliably assert here is
// "no growth" relative to the baseline. // "no growth" relative to the baseline.
Assert.True(UnmanagedMemoryHandle.TotalOutstandingHandles <= baselineHandles); Assert.True(UnmanagedMemoryHandle.TotalOutstandingHandles <= baselineHandles);
GC.KeepAlive(allocator);
} }
} }
@ -392,7 +391,7 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
private static void AllocateSingleAndForget(UniformUnmanagedMemoryPoolMemoryAllocator allocator, int length) private static void AllocateSingleAndForget(UniformUnmanagedMemoryPoolMemoryAllocator allocator, int length)
{ {
// Allocate and intentionally do not dispose. // Allocate and intentionally do not dispose.
IMemoryOwner<byte>? g = allocator.Allocate<byte>(length); IMemoryOwner<byte> g = allocator.Allocate<byte>(length);
// Touch the memory to ensure the buffer is actually materialized/usable. // Touch the memory to ensure the buffer is actually materialized/usable.
g.GetSpan()[0] = 42; g.GetSpan()[0] = 42;

Loading…
Cancel
Save