|
|
@ -175,6 +175,12 @@ namespace SixLabors.ImageSharp.Tests.Memory |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void CreateWithAggressivePooling() |
|
|
public void CreateWithAggressivePooling() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!TestEnvironment.Is64BitProcess) |
|
|
|
|
|
{ |
|
|
|
|
|
// can lead to OutOfMemoryException
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateWithAggressivePooling(); |
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateWithAggressivePooling(); |
|
|
|
|
|
|
|
|
Assert.True(this.CheckIsRentingPooledBuffer<Rgba32>(4096 * 4096)); |
|
|
Assert.True(this.CheckIsRentingPooledBuffer<Rgba32>(4096 * 4096)); |
|
|
@ -183,6 +189,12 @@ namespace SixLabors.ImageSharp.Tests.Memory |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void CreateDefault() |
|
|
public void CreateDefault() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!TestEnvironment.Is64BitProcess) |
|
|
|
|
|
{ |
|
|
|
|
|
// can lead to OutOfMemoryException
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateDefault(); |
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateDefault(); |
|
|
|
|
|
|
|
|
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2 * 4096 * 4096)); |
|
|
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2 * 4096 * 4096)); |
|
|
@ -192,6 +204,12 @@ namespace SixLabors.ImageSharp.Tests.Memory |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void CreateWithModeratePooling() |
|
|
public void CreateWithModeratePooling() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!TestEnvironment.Is64BitProcess) |
|
|
|
|
|
{ |
|
|
|
|
|
// can lead to OutOfMemoryException
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateWithModeratePooling(); |
|
|
this.MemoryManager = ArrayPoolMemoryManager.CreateWithModeratePooling(); |
|
|
|
|
|
|
|
|
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2048 * 2048)); |
|
|
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2048 * 2048)); |
|
|
|