Exemplo n.º 1
0
    public unsafe static ArrayPointer <T> GetArray <T> (this IMemoryManager manager, int count)
        where T : unmanaged
    {
        if (count < 1)
        {
            throw new ArgumentOutOfRangeException(nameof(count), "Count must be greater than zero.");
        }

        var mem = manager.GetMemory <T> (count);

        return(new ArrayPointer <T> (mem, count));
    }