icecat: add release icecat-140.7.0-1gnu1 for ecne

This commit is contained in:
Ark74 2026-01-18 00:07:02 -06:00
parent 7d0f5dab3b
commit 30225f2e73
156 changed files with 9131 additions and 4525 deletions

View file

@ -996,6 +996,8 @@ struct CompareWrapper<T, U, false> {
} // namespace detail
enum class SortBoundsCheck { Enable, Disable };
//
// nsTArray_Impl contains most of the guts supporting nsTArray, FallibleTArray,
// AutoTArray.
@ -2376,7 +2378,7 @@ class nsTArray_Impl
// nsTArray_RelocationStrategy.
//
// @param aComp The Comparator used to collate elements.
template <class Comparator>
template <SortBoundsCheck Check = SortBoundsCheck::Enable, class Comparator>
void Sort(const Comparator& aComp) {
static_assert(std::is_move_assignable_v<value_type>);
static_assert(std::is_move_constructible_v<value_type>);
@ -2385,13 +2387,20 @@ class nsTArray_Impl
auto compFn = [&comp](const auto& left, const auto& right) {
return comp.LessThan(left, right);
};
std::sort(Elements(), Elements() + Length(), compFn);
if constexpr (Check == SortBoundsCheck::Enable) {
std::sort(begin(), end(), compFn);
} else {
std::sort(Elements(), Elements() + Length(), compFn);
}
::detail::AssertStrictWeakOrder(Elements(), Elements() + Length(), compFn);
}
// A variation on the Sort method defined above that assumes that
// 'operator<' is defined for 'value_type'.
void Sort() { Sort(nsDefaultComparator<value_type, value_type>()); }
template <SortBoundsCheck Check = SortBoundsCheck::Enable>
void Sort() {
Sort(nsDefaultComparator<value_type, value_type>());
}
// This method sorts the elements of the array in a stable way (i.e. not
// changing the relative order of elements considered equal by the
@ -2402,7 +2411,7 @@ class nsTArray_Impl
// nsTArray_RelocationStrategy.
//
// @param aComp The Comparator used to collate elements.
template <class Comparator>
template <SortBoundsCheck Check = SortBoundsCheck::Enable, class Comparator>
void StableSort(const Comparator& aComp) {
static_assert(std::is_move_assignable_v<value_type>);
static_assert(std::is_move_constructible_v<value_type>);
@ -2411,12 +2420,17 @@ class nsTArray_Impl
auto compFn = [&comp](const auto& lhs, const auto& rhs) {
return comp.LessThan(lhs, rhs);
};
std::stable_sort(Elements(), Elements() + Length(), compFn);
if constexpr (Check == SortBoundsCheck::Enable) {
std::stable_sort(begin(), end(), compFn);
} else {
std::stable_sort(Elements(), Elements() + Length(), compFn);
}
::detail::AssertStrictWeakOrder(Elements(), Elements() + Length(), compFn);
}
// A variation on the StableSort method defined above that assumes that
// 'operator<' is defined for 'value_type'.
template <SortBoundsCheck Check = SortBoundsCheck::Enable>
void StableSort() {
StableSort(nsDefaultComparator<value_type, value_type>());
}

View file

@ -651,6 +651,15 @@ static void FixedSizeEntryMover(PLDHashTable*, const PLDHashEntryHdr* aFrom,
memcpy(aTo, aFrom, N);
}
// Helper type which wraps the access to EntryType::ALLOW_MEMMOVE. This is done
// to ensure that the MOZ_NEEDS_MEMMOVABLE_TYPE attribute is applied to the
// entry if we're going to use FixedSizeEntryMover, performing extra
// compile-time checks against the use of non-memmoveable types.
template <class EntryType, bool = EntryType::ALLOW_MEMMOVE>
struct MOZ_NEEDS_MEMMOVABLE_TYPE CheckAllowMemmove : std::true_type {};
template <class EntryType>
struct CheckAllowMemmove<EntryType, false> : std::false_type {};
} // namespace detail
} // namespace mozilla
@ -676,7 +685,9 @@ template <class EntryType>
// function avoids that problem.
static const PLDHashTableOps sOps = {
s_HashKey, s_MatchEntry,
EntryType::ALLOW_MEMMOVE
// We intentionally indirect the access of ALLOW_MEMMOVE through
// CheckAllowMemmove to perform some additional static analysis.
mozilla::detail::CheckAllowMemmove<EntryType>::value
? mozilla::detail::FixedSizeEntryMover<sizeof(EntryType)>
: s_CopyEntry,
// Simplify hashtable clearing in case our entries are trivially