On Tue, Sep 10, 2024 at 05:19:53PM -0400, Dave Tapuska wrote:
> First to get the string hash, then to actually insert it. I'm actually
> wondering if we really should have these permission policy fields actually
> be atomic strings anyways because then we wouldn't have refs of the same
> string in both the isolated feature map and the non-isolated feature map.
I'm not a WTF expert, and I couldn't line up your stack traces exactly
(it's a bit tricky when they have all templates cleared, because they
hold some of the key to understanding this), but it seems to me that the
call is Set(), which calls InlineAdd(), which does:
template <typename T, typename U, typename V, typename W, typename X>
template <typename IncomingKeyType, typename IncomingMappedType>
typename HashMap<T, U, V, W, X>::AddResult HashMap<T, U, V, W, X>::InlineAdd(
IncomingKeyType&& key,
IncomingMappedType&& mapped) {
return impl_.template insert<HashMapTranslator<KeyTraits, ValueTraits>>(
std::forward<IncomingKeyType>(key),
std::forward<IncomingMappedType>(mapped));
}
Note that it uses the HashMapTranslator based on KeyTraits (String),
not IncomingKeyType (const char *).
I know we have a heterogenous variant of find() (confusingly called Find()),
where you can define your own translator and thus hash the value directly,
but we don't seem to have this for insert() or Set(). I guess you can work
around this by an explicit cast to String() before the call, but it's not
ideal.
/* Steinar */
--
Homepage:
https://www.sesse.net/