mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-27 16:30:08 +02:00
* Slightly refactors RangeLists from the last Memory Changes MR, which fixes issue 61. * Convert as many const size array iterators to span iterators as possible. When iterating over a const size array, every iteration created a Span, now only the first iteration does in most places. * Now using object pooling for a few object types that were rapidly deleted and recreated. * Converted a few flag checks to binary operations to save memory allocations.
29 lines
709 B
C#
29 lines
709 B
C#
using System;
|
|
|
|
namespace Ryujinx.Common.Memory
|
|
{
|
|
/// <summary>
|
|
/// Array interface.
|
|
/// </summary>
|
|
/// <typeparam name="T">Element type</typeparam>
|
|
public interface IArray<T> where T : unmanaged
|
|
{
|
|
/// <summary>
|
|
/// Used to index the array.
|
|
/// </summary>
|
|
/// <param name="index">Element index</param>
|
|
/// <returns>Element at the specified index</returns>
|
|
ref T this[int index] { get; }
|
|
|
|
/// <summary>
|
|
/// Number of elements on the array.
|
|
/// </summary>
|
|
int Length { get; }
|
|
|
|
/// <summary>
|
|
/// Number of elements on the array.
|
|
/// </summary>
|
|
public Span<T> AsSpan();
|
|
}
|
|
}
|