The concept of small-string optimization (fixed capacity then heap alloc when too big) is something you can do for all container types that manage a single contiguous allocation, like: vector, flat map, & set, curious if there exists a working abstraction that can be reused tho?
In eastl, don’t their fixed-size containers all have allocation fallbacks? Wouldn’t then an eastl::fixed_vector<T, #, true> be pretty much what you’re asking for? You could even make # be sizeof(T)\SSOSize for the SSO space to be mostly consistent on type.
-
-
I wonder what eastl::fixed_vector would do if it was fixed_vector<T, 0, true>. Does it effectively just become a vector?
-
No clue, I've never used eastl. Maybe? I still think the smarter approach is polymorphic allocator all containers and then provide an in situ allocator ontop of this which you can then store inside all containers. Now it can use some fixed capacity, degrade to heap.
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.