|  9f51651eac # 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`. | ||
|---|---|---|
| .. | ||
| entity | ||
| query | ||
| schedule | ||
| storage | ||
| system | ||
| world | ||
| archetype.rs | ||
| bundle.rs | ||
| change_detection.rs | ||
| component.rs | ||
| event.rs | ||
| lib.rs | ||
| reflect.rs | ||