mirror of https://github.com/SixLabors/ImageSharp
Browse Source
- Add a null memory manager that doesn't do any actual memory managementpull/431/head
3 changed files with 56 additions and 1 deletions
@ -0,0 +1,19 @@ |
|||
namespace SixLabors.ImageSharp.Memory |
|||
{ |
|||
/// <summary>
|
|||
/// Implements <see cref="MemoryManager"/> by allocating new buffers on every call.
|
|||
/// </summary>
|
|||
public class NullMemoryManager : MemoryManager |
|||
{ |
|||
/// <inheritdoc />
|
|||
internal override Buffer<T> Allocate<T>(int size, bool clear = false) |
|||
{ |
|||
return new Buffer<T>(new T[size], size); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
internal override void Release<T>(Buffer<T> buffer) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue