modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.27k stars 2.59k forks source link

[stdlib] Make `InlineFixedVector` work on `CollectionElement` #3478

Open JoeLoser opened 1 month ago

JoeLoser commented 1 month ago

As mentioned at https://github.com/modularml/mojo/pull/3445#issuecomment-2338791234, we can make InlineFixedVector work on memory-only types such as CollectionElement. In the latest nightly tonight, InlineArray and Span have been relaxed to work on CollectionElement instead of CollectionElementNew, which should unblock this work.

gabrieldemarmiesse commented 1 month ago

Isn't InlinedFixedVector deprecated? I know the behavior is slightly different from small buffer optimization, at least the one I implemented, but I'm not sure this behavior will be needed a lot once https://github.com/modularml/mojo/pull/2825 lands.

JoeLoser commented 1 month ago

Isn't InlinedFixedVector deprecated? I know the behavior is slightly different from small buffer optimization, at least the one I implemented, but I'm not sure this behavior will be needed a lot once #2825 lands.

Yeah, but it's unclear how long it will be before we can land SBO, that's all.

gabrieldemarmiesse commented 1 month ago

Fair enough!