bevy/crates/bevy_ecs/src
James Liu 9f51651eac Replace BlobVec's swap_scratch with a swap_nonoverlapping (#4853)
# Objective
BlobVec currently relies on a scratch piece of memory allocated at initialization to make a temporary copy of a component when using `swap_remove_and_{forget/drop}`. This is potentially suboptimal as it writes to a, well-known, but random part of memory instead of using the stack.

## Solution
As the `FIXME` in the file states, replace `swap_scratch` with a call to `swap_nonoverlapping::<u8>`. The swapped last entry is returned as a `OwnedPtr`.

In theory, this should be faster as the temporary swap is allocated on the stack, `swap_nonoverlapping` allows for easier vectorization for bigger types, and the same memory is used between the swap and the returned `OwnedPtr`.
2022-11-16 20:57:43 +00:00
..
entity Make Entity::to_bits const (#6559) 2022-11-12 16:15:04 +00:00
query Fix FilteredAccessSet get_conflicts inconsistency (#5105) 2022-11-16 11:05:48 +00:00
schedule Fix clippy::iter_with_drain (#6485) 2022-11-06 01:42:15 +00:00
storage Replace BlobVec's swap_scratch with a swap_nonoverlapping (#4853) 2022-11-16 20:57:43 +00:00
system Fix FilteredAccessSet get_conflicts inconsistency (#5105) 2022-11-16 11:05:48 +00:00
world Remove redundant table and sparse set component IDs from Archetype (#4927) 2022-11-15 21:39:21 +00:00
archetype.rs Immutable sparse sets for metadata storage (#4928) 2022-11-15 22:21:19 +00:00
bundle.rs Remove redundant table and sparse set component IDs from Archetype (#4927) 2022-11-15 21:39:21 +00:00
change_detection.rs Implement IntoIterator for ECS wrapper types. (#5096) 2022-10-24 21:01:08 +00:00
component.rs Fix CI issues arising from use of Rust 1.64 (#6067) 2022-09-22 16:56:43 +00:00
event.rs derived Debug on EventReader (#6600) 2022-11-14 23:08:28 +00:00
lib.rs Fix get_unchecked_manual using archetype index instead of table row. (#6625) 2022-11-15 00:19:11 +00:00
reflect.rs Enable Constructing ReflectComponent/Resource (#6257) 2022-10-17 14:01:50 +00:00