@ -18,20 +18,20 @@ public static class MemoryAllocatorExtensions
/// <param name="memoryAllocator">The memory allocator.</param>
/// <param name="width">The buffer width.</param>
/// <param name="height">The buffer height.</param>
/// <param name="preferContiguosImageBuffers">A value indicating whether the allocated buffer should be contiguous, unless bigger than <see cref="int.MaxValue"/>.</param>
/// <param name="preferContiguou sImageBuffers">A value indicating whether the allocated buffer should be contiguous, unless bigger than <see cref="int.MaxValue"/>.</param>
/// <param name="options">The allocation options.</param>
/// <returns>The <see cref="Buffer2D{T}"/>.</returns>
public static Buffer2D < T > Allocate2D < T > (
this MemoryAllocator memoryAllocator ,
int width ,
int height ,
bool preferContiguosImageBuffers ,
bool preferContiguou sImageBuffers ,
AllocationOptions options = AllocationOptions . None )
where T : struct
{
long groupLength = ( long ) width * height ;
MemoryGroup < T > memoryGroup ;
if ( preferContiguosImageBuffers & & groupLength < int . MaxValue )
if ( preferContiguou sImageBuffers & & groupLength < int . MaxValue )
{
IMemoryOwner < T > buffer = memoryAllocator . Allocate < T > ( ( int ) groupLength , options ) ;
memoryGroup = MemoryGroup < T > . CreateContiguous ( buffer , false ) ;
@ -69,16 +69,16 @@ public static class MemoryAllocatorExtensions
/// <typeparam name="T">The type of buffer items to allocate.</typeparam>
/// <param name="memoryAllocator">The memory allocator.</param>
/// <param name="size">The buffer size.</param>
/// <param name="preferContiguosImageBuffers">A value indicating whether the allocated buffer should be contiguous, unless bigger than <see cref="int.MaxValue"/>.</param>
/// <param name="preferContiguou sImageBuffers">A value indicating whether the allocated buffer should be contiguous, unless bigger than <see cref="int.MaxValue"/>.</param>
/// <param name="options">The allocation options.</param>
/// <returns>The <see cref="Buffer2D{T}"/>.</returns>
public static Buffer2D < T > Allocate2D < T > (
this MemoryAllocator memoryAllocator ,
Size size ,
bool preferContiguosImageBuffers ,
bool preferContiguou sImageBuffers ,
AllocationOptions options = AllocationOptions . None )
where T : struct = >
Allocate2D < T > ( memoryAllocator , size . Width , size . Height , preferContiguosImageBuffers , options ) ;
Allocate2D < T > ( memoryAllocator , size . Width , size . Height , preferContiguou sImageBuffers , options ) ;
/// <summary>
/// Allocates a buffer of value type objects interpreted as a 2D region
@ -96,7 +96,7 @@ public static class MemoryAllocatorExtensions
where T : struct = >
Allocate2D < T > ( memoryAllocator , size . Width , size . Height , false , options ) ;
internal static Buffer2D < T > Allocate2DOvera ligned < T > (
internal static Buffer2D < T > Allocate2DOverA ligned < T > (
this MemoryAllocator memoryAllocator ,
int width ,
int height ,