hannobraun / inotify-rs

Idiomatic inotify wrapper for the Rust programming language
ISC License
254 stars 64 forks source link

Align input buffers before reading or writing inotify events #171

Closed FenrirWolf closed 3 years ago

FenrirWolf commented 3 years ago

Attempts to solve #155

This passes the current tests and eliminates the miri warning about unaligned references that currently triggers here, but I'm not certain if it's fully robust. The alignment code works by splitting away any unaligned portion of the input buffer, and so I'm not sure if the byte-tracking code in Stream and other places needs to be updated to reflect that.

hannobraun commented 3 years ago

Thank you for the contribution, @FenrirWolf!

This looks good. My only concern is whether other parts of the library need to be updated, as you mention. I will take a closer look next week.