From 1d5bb90cb0a1b457570019845fed207faed67a99 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 20:34:58 +0200 Subject: Adding upstream version 115.10.0esr. Signed-off-by: Daniel Baumann --- .../build_scripts/glean_parser_ext/templates/gifft.jinja2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'toolkit/components/glean/build_scripts/glean_parser_ext/templates') diff --git a/toolkit/components/glean/build_scripts/glean_parser_ext/templates/gifft.jinja2 b/toolkit/components/glean/build_scripts/glean_parser_ext/templates/gifft.jinja2 index 4a58ef5411..9d0c10cdf6 100644 --- a/toolkit/components/glean/build_scripts/glean_parser_ext/templates/gifft.jinja2 +++ b/toolkit/components/glean/build_scripts/glean_parser_ext/templates/gifft.jinja2 @@ -35,7 +35,10 @@ using Telemetry::{{ probe_type }}ID; using MetricId = uint32_t; // Same type as in api/src/private/mod.rs using TimerId = uint64_t; // Same as in TimingDistribution.h. -using MetricTimerTuple = std::tuple; +struct MetricTimerTuple { + MetricId mMetricId; + TimerId mTimerId; +}; class MetricTimerTupleHashKey : public PLDHashEntryHdr { public: using KeyType = const MetricTimerTuple&; @@ -49,15 +52,17 @@ class MetricTimerTupleHashKey : public PLDHashEntryHdr { KeyType GetKey() const { return mValue; } bool KeyEquals(KeyTypePointer aKey) const { - return std::get<0>(*aKey) == std::get<0>(mValue) && std::get<1>(*aKey) == std::get<1>(mValue); + return aKey->mMetricId == mValue.mMetricId && + aKey->mTimerId == mValue.mTimerId; } static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; } static PLDHashNumber HashKey(KeyTypePointer aKey) { // Chosen because this is how nsIntegralHashKey does it. - return HashGeneric(std::get<0>(*aKey), std::get<1>(*aKey)); + return HashGeneric(aKey->mMetricId, aKey->mTimerId); } enum { ALLOW_MEMMOVE = true }; + static_assert(std::is_trivially_copyable_v); private: const MetricTimerTuple mValue; @@ -170,6 +175,7 @@ class ScalarIDHashKey : public PLDHashEntryHdr { return static_cast::type>(*aKey); } enum { ALLOW_MEMMOVE = true }; + static_assert(std::is_trivially_copyable_v); private: const ScalarID mValue; -- cgit v1.2.3