-
Notifications
You must be signed in to change notification settings - Fork 347
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We should have an InlineOrHeap
sequence/collection that uses an InlineArray
to some extent, and more than that it allocates on heap.
This will avoid allocating on heap when there are not enough values to justify so.
This can be pretty useful in performance-sensitive code.
Something along the lines of:
enum InlineOrHeap<let count: Int, Element> {
case inline(InlineArray<count, Element>)
case heap(Array<Element>)
}
Usage:
let tinyValue: InlineOrHeap<8, Int> = ...
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request