Add pitched malloc and 2d memcpy to cust #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 whatmalloc
(includingmalloc_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.