-
Notifications
You must be signed in to change notification settings - Fork 63
struct Pal: Add inner mutability to pal buffer
#950
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
struct Pal: Add inner mutability to pal buffer
#950
Conversation
63db3b0 to
b4144f9
Compare
c3f8db0 to
ef78bbc
Compare
b4144f9 to
2cfe342
Compare
ef78bbc to
e7a2e46
Compare
2cfe342 to
e603367
Compare
e7a2e46 to
63e9914
Compare
b6ff24c to
2105c1b
Compare
6400056 to
815bb20
Compare
815bb20 to
22c7422
Compare
|
I fixed this up so that we don't allow direct access to the guard cast and instead require users to index using the desired output type. Please take another look. |
e3b8f4f to
3a8ab96
Compare
kkysen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation LGTM, I just had a question about the naming, and also if we can impl Mul<usize> for Bounds.
| bounds: Bounds, | ||
| } | ||
|
|
||
| impl<'a, T: AsMutPtr> DisjointImmutGuard<'a, T, [u8]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine for now, but as a future potential optimization, we should see if we can add alignment info to the [u8] here, as without it, fn cast has to do an alignment check, even though the buffer we're indexing into is usually already aligned enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
22c7422 to
4a716c2
Compare
4a716c2 to
0d3ac6c
Compare
The pal buffer is a type erased Pixel buffer that needs to be accessed concurrently. This change adds support for casting DisjointMut guards from [u8] buffers to appropriate bitdepth-dependent types that implement FromBytes.
0d3ac6c to
c9c537b
Compare
The
palbuffer is a type-erasedPixelbuffer that needs to be accessed concurrently. This change adds support for castingDisjointMutguards from[u8]buffers to appropriate bitdepth-dependent types that implementFromBytes.