|
|
|
@ -11,6 +11,17 @@ namespace SixLabors.ImageSharp.Memory |
|
|
|
/// </summary>
|
|
|
|
public abstract class MemoryManager |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Allocates a <see cref="Buffer{T}"/> of size <paramref name="size"/>.
|
|
|
|
/// Note: Depending on the implementation, the buffer may not cleared before
|
|
|
|
/// returning, so it may contain data from an earlier use.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="T">Type of the data stored in the buffer</typeparam>
|
|
|
|
/// <param name="size">Size of the buffer to allocate</param>
|
|
|
|
/// <returns>A buffer of values of type <typeparamref name="T"/>.</returns>
|
|
|
|
internal abstract Buffer<T> Allocate<T>(int size) |
|
|
|
where T : struct; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Allocates a <see cref="Buffer{T}"/> of size <paramref name="size"/>, optionally
|
|
|
|
/// clearing the buffer before it gets returned.
|
|
|
|
@ -19,7 +30,7 @@ namespace SixLabors.ImageSharp.Memory |
|
|
|
/// <param name="size">Size of the buffer to allocate</param>
|
|
|
|
/// <param name="clear">True to clear the backing memory of the buffer</param>
|
|
|
|
/// <returns>A buffer of values of type <typeparamref name="T"/>.</returns>
|
|
|
|
internal abstract Buffer<T> Allocate<T>(int size, bool clear = false) |
|
|
|
internal abstract Buffer<T> Allocate<T>(int size, bool clear) |
|
|
|
where T : struct; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|