Skip to content
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

Add ArraySegment<byte> as native supported type #2219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bdelayen
Copy link

@bdelayen bdelayen commented May 8, 2024

Aim is to be able to provide pooled buffers with an adjustable offset and count to the library.

This changes very little of the existing logic and does not break existing API and works on all .NET versions.

The ArraySegment will now be natively supported (like string, long or byte[]) without needing a user provided serializer. It also allows the use of pooled buffers and will help get the maximum performance out of the library.

This is one of the least invasive ways to add support for this feature that I found. (Span<>, Memory<> need recent versions and require changing the buffer pinning code).

Aim is to be able to provide pooled buffers with an adjustable
offset and count to the library.

This changes very little of the actual logic and does not break
existing API and works on all .NET versions
Copy link

cla-assistant bot commented May 8, 2024

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

None yet

1 participant