feat(collections)!: switch to ref struct enumerators
Refactor all unsafe collection enumerators to use ref struct types, removing support for boxing and standard .NET enumeration interfaces. GetEnumerator methods now return stack-only, more efficient enumerators with [UnscopedRef] and inlining attributes. IEnumerable<T> and IEnumerable implementations are removed from affected types. Interfaces now require unmanaged types. Also includes minor doc and bug fixes. BREAKING CHANGE: Enumerators are no longer compatible with LINQ, and collections no longer implement IEnumerable/IEnumerator.
This commit is contained in:
@@ -27,7 +27,7 @@ public unsafe interface IUnsafeCollection : IDisposable
|
||||
void* GetUnsafePtr();
|
||||
}
|
||||
|
||||
public interface IUnsafeCollection<T> : IUnsafeCollection, IEnumerable<T>
|
||||
public interface IUnsafeCollection<T> : IUnsafeCollection
|
||||
where T : unmanaged
|
||||
{
|
||||
/// <summary>
|
||||
@@ -47,7 +47,7 @@ public interface IUnsafeCollection<T> : IUnsafeCollection, IEnumerable<T>
|
||||
void Resize(int newSize, AllocationOption option);
|
||||
}
|
||||
|
||||
public interface IUnsafeHashCollection<T> : IEnumerable<T>, IDisposable
|
||||
public interface IUnsafeHashCollection<T> : IDisposable
|
||||
where T : unmanaged
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user