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

Change interface from byte[] to Memory<byte> #13

Open
Blackclaws opened this issue Mar 2, 2023 · 1 comment
Open

Change interface from byte[] to Memory<byte> #13

Blackclaws opened this issue Mar 2, 2023 · 1 comment

Comments

@Blackclaws
Copy link

It would be great if the interface didn't take plain byte arrays. The reason being that you can't really allocate those easily from a block based system. Memory on the other hand is wrapper (like Span<>) around parts of memory that can be passed around between functions and stored in fields/properties. It supports pinning just like basic arrays do and byte[] should just be convertible to Memory so users of your library shouldn't be impacted by the API change.

@krisrok
Copy link

krisrok commented Jul 17, 2023

Not sure but since we're in Unity-land anyway, wouldn't it suffice to use NativeArray instead for the same benefits? This way we would not need the extra dependency.

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

2 participants