rust-vmm / vm-virtio

virtio implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[virtio-queue] document unchecked_* operations safety

lauralt opened this issue · comments

We have a couple of unchecked_* operations that would benefit from a comment on why they are safe to use, e.g. https://github.com/rust-vmm/vm-virtio/blob/main/crates/virtio-queue/src/lib.rs#L581.

There are also some multiplications involved in these operations. The comments should also explain why the "*" is safe, and if it's not, we should use checked_mul instead.