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 pitched malloc and 2d memcpy to cust #64

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

Conversation

kjetilkjeka
Copy link
Contributor

@kjetilkjeka kjetilkjeka commented Mar 17, 2022

Fixes #56

Add pitched malloc and 2d memcpy to cust::memory.

The memcpy_2d functions is working on elements in width/height instead of bytes. This does not correspond to what the other memcpy functions are currently doing but corresponds to what malloc (including malloc_pitched) is currently doing.

I see many good arguments for using bytes and many good arguments for using elements. The important thing is that the interface is consistent. My assumption is that it is more important with consistency between malloc and memcpy than between memcpys. Making the module completely consistent is outside the scope of this PR as discussed in #56

I also updated cust from 2018 edition to 2021 edition. This was mainly to get TryInto automatically into scope. I hope that was Ok.

@therishidesai
Copy link

Is there any path forward on getting this merged in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants