Use-after-frees and ABA problems can be addressed by using generation counts with your object pool. Rust's slotmap crate handles this out of the box, AFAIK.