Skip to content

Move Span.DangerousCreate to MemoryMarshal.Create #24562

Description

@KrzysztofCwalina

current API:

    public struct Span<T> {
        public static Span<T> DangerousCreate(object obj, ref T objectData, int length);
    }
    public struct ReadOnlySpan<T> {
        public static ReadOnlySpan<T> DangerousCreate(object obj, ref T objectData, int length);
    }

proposed API:

    public static class MemoryMarshal {
        public static Span<T> CreateSpan(object obj, ref T objectData, int length);
        public static ReadOnlySpan<T> CreateReadOnlySpan(object obj, ref T objectData, int length);
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions