bevy/crates/bevy_ecs/src/storage
Jakob Hellermann d63b7e9568 some cleanup for bevy_ptr (#4668)
1. change `PtrMut::as_ptr(self)` and `OwnedPtr::as_ptr(self)` to take `&self`, otherwise printing the pointer will prevent doing anything else afterwards
2. make all `as_ptr` methods safe. There's nothing unsafe about obtaining a pointer, these kinds of methods are safe in std as well [str::as_ptr](https://doc.rust-lang.org/stable/std/primitive.str.html#method.as_ptr), [Rc::as_ptr](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.as_ptr)
3. rename `offset`/`add` to `byte_offset`/`byte_add`. The unprefixed methods in std add in increments of `std::mem::size_of::<T>`, not in bytes. There's a PR for rust to add these byte_ methods https://github.com/rust-lang/rust/pull/95643 and at the call site it makes it much more clear that you need to do `.byte_add(i * layout_size)` instead of `.add(i)`
2022-05-06 19:15:24 +00:00
..
blob_vec.rs some cleanup for bevy_ptr (#4668) 2022-05-06 19:15:24 +00:00
mod.rs Basic docs for Storages (#3391) 2021-12-20 20:50:51 +00:00
sparse_set.rs bevy_ptr standalone crate (#4653) 2022-05-04 19:16:10 +00:00
table.rs bevy_ptr standalone crate (#4653) 2022-05-04 19:16:10 +00:00