Closed scottmcm closed 3 years ago
Thank you! Yes, aligning is definitely an assumption that seems reasonable now, but could become invalid in the future! Also doing it perfectly properly with align_to would also be welcomed.
@scottmcm Also thank you for the first external pull request!
A
Vec<u8>
's buffer is only guaranteed to be 1-aligned, but it's used here in code assuming it's 4-aligned. That might work, depending on what the allocator does, but it should be checked to avoid UB.(Alternatively it could over-allocate the buffer and do something like
align_to
, but I didn't want to make broad changes.)