Skip to content

(future) Consider ReadOnlySequence everywhere #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Warpten opened this issue Feb 1, 2025 · 0 comments
Open

(future) Consider ReadOnlySequence everywhere #3

Warpten opened this issue Feb 1, 2025 · 0 comments

Comments

@Warpten
Copy link
Contributor

Warpten commented Feb 1, 2025

(ReadOnly)Span<T> is limited to int.MaxValue amout of entries. For all intents and purposes this is fine but is bound to break on files larger than 2GB. The alternative here is to instead use (ReadOnly)Sequence<T>, but this introduces the need for special care across individual span boundaries.

Normally this is also a non-issue because TACT || CASC files are not larger than 2 GB, but this is something to keep in mind for the future.

The general consensus would be to use ReadOnlySequenceAccessor and work off the sequence, trying to abstract away the span boundaries.

References:

  1. Memory<T> and large memory mapped files dotnet/runtime#24805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant