Closed wmanley closed 3 years ago
@cberner: I consider this mergable. Please let me know if you want any changes. There are no API changes here.
Great! I'll take a look soon
Thanks for the review. I've fixed the issues and force-pushed.
Merged. Thanks!
Instead we use
zerocopy::FromBytes
.Previously the code did not ensure alignment, which could lead to undefined behaviour. Now we do check alignment I've had to fix it in a few places using
AlignedData<[u8; sz]>
as a buffer in tests. Unfortunately we can't useBox<AlignedData<u8; BUFFER_SIZE>>
as our main buffer because it's too large to create on the stack and Rust currently offers no way to allocate it directly on the heap. Instead we have to fiddle with offsets for theVec
.