There's no use case for stateful comparators, so they can be just plain
function pointers.
This is used in some hot places like CSS selector matching.
Differential Revision: https://phabricator.services.mozilla.com/D77084
The instantiations of the externed templates need to be in the same translation unit as the definitions. Currently they work due to building in unified mode.
Differential Revision: https://phabricator.services.mozilla.com/D69467
--HG--
extra : moz-landing-system : lando
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.
Differential Revision: https://phabricator.services.mozilla.com/D68561
--HG--
extra : moz-landing-system : lando
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's __attribute__((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.
Also remove MOZ_MUST_USE from nsIMemoryReporter's function pointer typedefs. [[nodiscard]] is an attribute of a function's declaration, not the function's type, and thus can't be applied to function pointers or lambdas.
Differential Revision: https://phabricator.services.mozilla.com/D68138
--HG--
extra : moz-landing-system : lando
TSan reports a benign race when accessing a string between main thread and IPDL background thread. The reason is that we use `memory_order_relaxed` to check the reference count of StringBuffer. To avoid the benign race, this patch uses `memory_order_acquire` to perform acquire memory synchronization only for TSan build.
Differential Revision: https://phabricator.services.mozilla.com/D57620
--HG--
extra : moz-landing-system : lando
musl libc does not define these types through the other headers
included by this file, which causes errors when building RemoteUtils.cpp
(which indirectly includes nsCharTraits.h):
error: unknown type name 'int32_t'
Differential Revision: https://phabricator.services.mozilla.com/D61040
--HG--
extra : moz-landing-system : lando
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.
Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:
* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.
Differential Revision: https://phabricator.services.mozilla.com/D56440
--HG--
extra : moz-landing-system : lando
Needed to compare with `nsTextFragment::Get1b()` which returns latin1-encoded
characters. Used in a subsequent review.
Differential Revision: https://phabricator.services.mozilla.com/D52343
--HG--
extra : moz-landing-system : lando
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.
Alternatively he'd have to do something like:
Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))
or something of that sort, which looks a bit uglier.
Differential Revision: https://phabricator.services.mozilla.com/D50523
--HG--
extra : moz-landing-system : lando
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.
Alternatively he'd have to do something like:
Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))
or something of that sort, which looks a bit uglier.
Differential Revision: https://phabricator.services.mozilla.com/D50523
--HG--
extra : moz-landing-system : lando
Also remove most C++-side optimizations for avoiding calls to Rust
for short strings now that we have LTO between C++ and Rust. Since
LTO still leaves the overhead of one function call layer, inlined
function call avoidance optimization is left in place in the
IsUTF8 and in the 8-bit IsASCII cases for which perfherder flags
the difference as significant for the length 15.
Differential Revision: https://phabricator.services.mozilla.com/D40999
--HG--
extra : moz-landing-system : lando