mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The properties of this multimap cache are: 1. Values are stored (inline if Small) in a Vector and our map internally maps keys to (start, length) of slices of the Vector. This is done instead of storing arrays refs to ensure that if our array goes from small -> large, we do not have stale pointers. 2. Values are only allowed to be inserted all at once. This is ok, since this is a cache. 3. One is not storing individual small vectors in a map (or state storing SmallVectors). This can inadvertantly add up to using a lot of memory and is not needed for homogenous data.
1.7 KiB
1.7 KiB