bevy/crates/bevy_ecs/src/system
Giacomo Stevanato e75c2f8b16
Remove a ptr-to-int cast in CommandQueue::apply (#10475)
# Objective

- `CommandQueue::apply` calculates the address of the end of the
internal buffer as a `usize` rather than as a pointer, requiring two
casts of `cursor` to `usize`. Casting pointers to integers is generally
discouraged and may also prevent optimizations. It's also unnecessary
here.

## Solution

- Calculate the end address as a pointer rather than a `usize`.

Small note:

A trivial translation of the old code to use pointers would have
computed `end_addr` as `cursor.add(self.bytes.len())`, which is not
wrong but is an additional `unsafe` operation that also needs to be
properly documented and proven correct. However this operation is
already implemented in the form of the safe `as_mut_ptr_range`, so I
just used that.
2023-11-09 19:32:33 +00:00
..
commands Remove a ptr-to-int cast in CommandQueue::apply (#10475) 2023-11-09 19:32:33 +00:00
adapter_system.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
combinator.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
exclusive_function_system.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
exclusive_system_param.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
function_system.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
mod.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
query.rs Hide UnsafeWorldCell::unsafe_world (#9741) 2023-10-02 12:46:43 +00:00
system_param.rs ParamSets containing non-send parameters should also be non-send (#10211) 2023-10-21 18:07:52 +00:00
system_registry.rs Allow registering boxed systems (#10378) 2023-11-08 14:54:32 +00:00
system.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00