Implement `SystemParam` for `SmallVec` (#24405)
# Objective To register a system from a script, I need to support for dynamic number of system parameters (since scripting languages usually don't play well with generics). Right now the only solution is to use `Vec<T>` as a system param which is allocated every time the system runs. But it would be nice to avoid allocations when the number of system parameters is low. ## Solution Implement `SystemParam` for `SmallVec`. It's already a dependency for `bevy_ecs` and allows to avoid allocations with user-defined number of system parameters. ## Testing - Did you test these changes? If so, how? I tried creating a system with a `SmallVec<[Local<usize>; 8]>`. - Are there any parts that need more testing? I don't think so. The code follows `Vec` impl.
H
Hennadii Chernyshchyk committed
da6b0e2be330197adc97b90cfe79e05e48e72bbb
Parent: 8aeba06
Committed by GitHub <noreply@github.com>
on 5/28/2026, 7:49:27 PM