Commit Graph

3 Commits

Author SHA1 Message Date
Evan Wilde
6dac520b66 NFC: Fix signed unsigned comparison warnings
This patch fixes the unsigned/signed comparison warnings in the
unittests caused by comparing an unsigned integer with the signed
integer literal. The offending signed integer literals have been
replaced with unsigned integer literals.
2020-12-10 16:02:33 -08:00
Michael Gottesman
dd7f780993 [multimapcache] Change multi-map cache to use a std::function instead of CRTP.
This makes it so one uses a passed in std::function, instead of an impl class to
map a key to a list of values to be cached.
2020-04-15 12:23:10 -07:00
Michael Gottesman
00d4576977 [multimapcache] Add an efficient CRTP based write-once multimap cache that can be small.
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.
2020-03-31 15:12:37 -07:00