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

BufferType::SliceData should not take a Vec<u8> as parameter #15

Open
Gnurou opened this issue Jul 9, 2024 · 1 comment
Open

BufferType::SliceData should not take a Vec<u8> as parameter #15

Gnurou opened this issue Jul 9, 2024 · 1 comment

Comments

@Gnurou
Copy link
Collaborator

Gnurou commented Jul 9, 2024

Taking a Vec here means the client is likely to make an unneeded copy of the input data. Turning this parameter into a &[u8] means adding a lifetime parameter to the whole of BufferType...

Maybe the solution is to use the types of the members directly for Buffer::new, and remove BufferType altogether? This would need a new trait to obtain the (ptr, size) tuple but is probably cleaner.

@Gnurou
Copy link
Collaborator Author

Gnurou commented Jul 9, 2024

Actually that sounds similar to issue #11 .

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