Stack-allocated collections

You can always try to implement your own copy-on-write fixed-size collection using ManagedBuffer.

I believe this class allows you to access the same optimisations as most of the Swift native collections use. It is widely used by the swift-collections repo (for example).

1 Like