News for hackers. Stuff that matters.
Re:Unreal Rust by oconnor663 on Sunday September 04, 2022 @06:27PM (#32718333)
I always want to be careful with phrases like "bypassing safety checks", because of course the Vec/index pattern is 100% safe and (like any 100% safe Rust program) will (approximately) never trigger undefined behavior. But it's true that what was formerly undefined behavior will still be a bug, where a stale index accidentally refers to a new object that happens to get allocated in the same spot. You can use slabs and generational indexes to catch these bugs, but I don't know whether the performance cost of generational indexes is acceptable in this case.
Re:Unreal Rust by ChickeNES on Sunday September 04, 2022 @07:45PM (#32718881)
> here a stale index accidentally refers to a new object that happens to get allocated in the same spot.

Given we're talking video games, you could also not worry and let speedrunners take advantage of it... ;)