Bug Summary

File:var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerLabels.h
Warning:line 157, column 9
Branch condition evaluates to a garbage value

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name TestBaseProfiler.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozglue/tests -fcoverage-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozglue/tests -resource-dir /usr/lib/llvm-19/lib/clang/19 -include /var/lib/jenkins/workspace/firefox-scan-build/config/gcc_hidden.h -include /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D MOZ_HAS_MOZGLUE -I /var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozglue/tests -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/testing -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/backward -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fdeprecated-macro -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fno-sized-deallocation -fno-aligned-allocation -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2024-09-22-115206-3586786-1 -x c++ /var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp

/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp

1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7#include "BaseProfiler.h"
8
9#include "mozilla/Attributes.h"
10#include "mozilla/BaseAndGeckoProfilerDetail.h"
11#include "mozilla/BaseProfileJSONWriter.h"
12#include "mozilla/BaseProfilerDetail.h"
13#include "mozilla/FailureLatch.h"
14#include "mozilla/FloatingPoint.h"
15#include "mozilla/NotNull.h"
16#include "mozilla/ProgressLogger.h"
17#include "mozilla/ProportionValue.h"
18
19#ifdef MOZ_GECKO_PROFILER1
20# include "mozilla/BaseProfilerMarkerTypes.h"
21# include "mozilla/leb128iterator.h"
22# include "mozilla/ModuloBuffer.h"
23# include "mozilla/mozalloc.h"
24# include "mozilla/PowerOfTwo.h"
25# include "mozilla/ProfileBufferChunk.h"
26# include "mozilla/ProfileBufferChunkManagerSingle.h"
27# include "mozilla/ProfileBufferChunkManagerWithLocalLimit.h"
28# include "mozilla/ProfileBufferControlledChunkManager.h"
29# include "mozilla/ProfileChunkedBuffer.h"
30# include "mozilla/Vector.h"
31#endif // MOZ_GECKO_PROFILER
32
33#if defined(_MSC_VER) || defined(__MINGW32__)
34# include <windows.h>
35# include <mmsystem.h>
36# include <process.h>
37#else
38# include <errno(*__errno_location ()).h>
39# include <time.h>
40#endif
41
42#include <algorithm>
43#include <atomic>
44#include <iostream>
45#include <random>
46#include <thread>
47#include <type_traits>
48#include <utility>
49
50void TestFailureLatch() {
51 printf("TestFailureLatch...\n");
52
53 // Test infallible latch.
54 {
55 mozilla::FailureLatchInfallibleSource& infallibleLatch =
56 mozilla::FailureLatchInfallibleSource::Singleton();
57
58 MOZ_RELEASE_ASSERT(!infallibleLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!infallibleLatch.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!infallibleLatch.Fallible())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!infallibleLatch.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 58); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.Fallible()"
")"); do { *((volatile int*)__null) = 58; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
59 MOZ_RELEASE_ASSERT(!infallibleLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!infallibleLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!infallibleLatch.Failed())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!infallibleLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 59); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.Failed()"
")"); do { *((volatile int*)__null) = 59; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
60 MOZ_RELEASE_ASSERT(!infallibleLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!infallibleLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!infallibleLatch.GetFailure(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!infallibleLatch.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 60); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 60; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
61 MOZ_RELEASE_ASSERT(&infallibleLatch.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&infallibleLatch.SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&infallibleLatch.SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 62); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 62; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
62 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&infallibleLatch.SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&infallibleLatch.SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 62); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 62; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
63 MOZ_RELEASE_ASSERT(&std::as_const(infallibleLatch).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(infallibleLatch).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(infallibleLatch).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 64); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 64; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
64 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(infallibleLatch).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(infallibleLatch).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 64); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 64; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
65 }
66
67 // Test failure latch basic functions.
68 {
69 mozilla::FailureLatchSource failureLatch;
70
71 MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 71); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()"
")"); do { *((volatile int*)__null) = 71; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
72 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 72); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 72; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
73 MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 73); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 73; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
74 MOZ_RELEASE_ASSERT(&failureLatch.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&failureLatch.SourceFailureLatch() == &failureLatch
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&failureLatch.SourceFailureLatch() == &failureLatch
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&failureLatch.SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 74); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&failureLatch.SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 74; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75 MOZ_RELEASE_ASSERT(&std::as_const(failureLatch).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(failureLatch).SourceFailureLatch(
) == &failureLatch)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&std::as_const(failureLatch
).SourceFailureLatch() == &failureLatch))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 76); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 76; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
76 &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(failureLatch).SourceFailureLatch(
) == &failureLatch)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&std::as_const(failureLatch
).SourceFailureLatch() == &failureLatch))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 76); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 76; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
77
78 failureLatch.SetFailure("error");
79
80 MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 80); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()"
")"); do { *((volatile int*)__null) = 80; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
81 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 81); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 81; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
82 MOZ_RELEASE_ASSERT(failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.GetFailure())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 82); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 82; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
83 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 83); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 83; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
84
85 failureLatch.SetFailure("later error");
86
87 MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 87); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()"
")"); do { *((volatile int*)__null) = 87; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
88 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 88); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 88; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
89 MOZ_RELEASE_ASSERT(failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.GetFailure())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 89); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 89; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
90 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 90); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 90; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
91 }
92
93 // Test SetFailureFrom.
94 {
95 mozilla::FailureLatchSource failureLatch;
96
97 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 97); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 97; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
98 failureLatch.SetFailureFrom(failureLatch);
99 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 99); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 99; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
100 MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 100; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
101
102 // SetFailureFrom with no error.
103 {
104 mozilla::FailureLatchSource failureLatchInnerOk;
105 MOZ_RELEASE_ASSERT(!failureLatchInnerOk.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerOk.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.Failed(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerOk.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 105); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.Failed()"
")"); do { *((volatile int*)__null) = 105; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
106 MOZ_RELEASE_ASSERT(!failureLatchInnerOk.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerOk.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.GetFailure
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerOk.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 106); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.GetFailure()"
")"); do { *((volatile int*)__null) = 106; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
107
108 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 108); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 108; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
109 failureLatch.SetFailureFrom(failureLatchInnerOk);
110 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 110; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
111
112 MOZ_RELEASE_ASSERT(!failureLatchInnerOk.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerOk.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.Failed(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerOk.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 112); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.Failed()"
")"); do { *((volatile int*)__null) = 112; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
113 MOZ_RELEASE_ASSERT(!failureLatchInnerOk.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerOk.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.GetFailure
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerOk.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 113); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.GetFailure()"
")"); do { *((volatile int*)__null) = 113; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
114 }
115 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 115); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 115; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
116 MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 116); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()"
")"); do { *((volatile int*)__null) = 116; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
117
118 // SetFailureFrom with error.
119 {
120 mozilla::FailureLatchSource failureLatchInnerError;
121 MOZ_RELEASE_ASSERT(!failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerError.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerError.Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerError.Failed()"
")"); do { *((volatile int*)__null) = 121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
122 MOZ_RELEASE_ASSERT(!failureLatchInnerError.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatchInnerError.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatchInnerError.GetFailure
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!failureLatchInnerError.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 122); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerError.GetFailure()"
")"); do { *((volatile int*)__null) = 122; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
123
124 failureLatchInnerError.SetFailure("inner error");
125 MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 125); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()"
")"); do { *((volatile int*)__null) = 125; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
126 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 127; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
127 strcmp(failureLatchInnerError.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 127; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
128
129 MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 129); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 129; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
130 failureLatch.SetFailureFrom(failureLatchInnerError);
131 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 131; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
132
133 MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 133); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()"
")"); do { *((volatile int*)__null) = 133; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
134 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
135 strcmp(failureLatchInnerError.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
136 }
137 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 137); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 137; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
138 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 138; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
139
140 failureLatch.SetFailureFrom(failureLatch);
141 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 141); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 141; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
142 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 142); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 142; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
143
144 // SetFailureFrom with error again, ignored.
145 {
146 mozilla::FailureLatchSource failureLatchInnerError;
147 failureLatchInnerError.SetFailure("later inner error");
148 MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 148); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()"
")"); do { *((volatile int*)__null) = 148; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
149 MOZ_RELEASE_ASSERT(strcmp(failureLatchInnerError.GetFailure(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 150); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
")"); do { *((volatile int*)__null) = 150; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
150 "later inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 150); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
")"); do { *((volatile int*)__null) = 150; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
151
152 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 152); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 152; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
153 failureLatch.SetFailureFrom(failureLatchInnerError);
154 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 154); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 154; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
155
156 MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 156); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()"
")"); do { *((volatile int*)__null) = 156; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
157 MOZ_RELEASE_ASSERT(strcmp(failureLatchInnerError.GetFailure(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
")"); do { *((volatile int*)__null) = 158; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
158 "later inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error"
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0"
")"); do { *((volatile int*)__null) = 158; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
159 }
160 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 160); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 160; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
161 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 161); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0"
")"); do { *((volatile int*)__null) = 161; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
162 }
163
164 // Test FAILURELATCH_IMPL_PROXY
165 {
166 class Proxy final : public mozilla::FailureLatch {
167 public:
168 explicit Proxy(mozilla::FailureLatch& aFailureLatch)
169 : mFailureLatch(WrapNotNull(&aFailureLatch)) {}
170
171 void Set(mozilla::FailureLatch& aFailureLatch) {
172 mFailureLatch = WrapNotNull(&aFailureLatch);
173 }
174
175 FAILURELATCH_IMPL_PROXY(*mFailureLatch)[[nodiscard]] bool Fallible() const final { return static_cast
<const ::mozilla::FailureLatch&>(*mFailureLatch) .Fallible
(); } void SetFailure(std::string aReason) final { static_cast
<::mozilla::FailureLatch&>(*mFailureLatch) .SetFailure
(std::move(aReason)); } [[nodiscard]] bool Failed() const final
{ return static_cast<const ::mozilla::FailureLatch&>
(*mFailureLatch) .Failed(); } [[nodiscard]] const char* GetFailure
() const final { return static_cast<const ::mozilla::FailureLatch
&>(*mFailureLatch) .GetFailure(); } [[nodiscard]] const
FailureLatch& SourceFailureLatch() const final { return static_cast
<const ::mozilla::FailureLatch&>(*mFailureLatch) .SourceFailureLatch
(); } [[nodiscard]] FailureLatch& SourceFailureLatch() final
{ return static_cast<::mozilla::FailureLatch&>(*mFailureLatch
) .SourceFailureLatch(); }
176
177 private:
178 mozilla::NotNull<mozilla::FailureLatch*> mFailureLatch;
179 };
180
181 Proxy proxy{mozilla::FailureLatchInfallibleSource::Singleton()};
182
183 MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 183); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()"
")"); do { *((volatile int*)__null) = 183; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
184 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
185 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 185); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 185; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
186 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 187; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
187 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 187; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
188 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 189); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 189; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
189 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 189); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 189; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
190
191 // Error from proxy.
192 {
193 mozilla::FailureLatchSource failureLatch;
194 proxy.Set(failureLatch);
195 MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 195); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()"
")"); do { *((volatile int*)__null) = 195; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
196 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 196); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 196; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
197 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 197); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 197; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
198 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &failureLatch
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
199 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 200); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 200; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
200 &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 200); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 200; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
201
202 proxy.SetFailure("error");
203 MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 203); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()"
")"); do { *((volatile int*)__null) = 203; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
204 MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 204); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 204; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
205 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 205); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 205; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
206 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
207
208 // Don't forget to stop pointing at soon-to-be-destroyed object.
209 proxy.Set(mozilla::FailureLatchInfallibleSource::Singleton());
210 }
211
212 // Error from proxy's origin.
213 {
214 mozilla::FailureLatchSource failureLatch;
215 proxy.Set(failureLatch);
216 MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 216); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()"
")"); do { *((volatile int*)__null) = 216; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
217 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 217); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 217; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
218 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 218); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 218; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
219 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &failureLatch
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 219); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 219; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
220 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 221; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
221 &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 221; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
222
223 failureLatch.SetFailure("error");
224 MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()"
")"); do { *((volatile int*)__null) = 224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
225 MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 225; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
226 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 226; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
227 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 227); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 227; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
228
229 // Don't forget to stop pointing at soon-to-be-destroyed object.
230 proxy.Set(mozilla::FailureLatchInfallibleSource::Singleton());
231 }
232
233 MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 233); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()"
")"); do { *((volatile int*)__null) = 233; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
234 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 234; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
235 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 235); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 235; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
236 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 237); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 237; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
237 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 237); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 237; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
238 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 239; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
239 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 239; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
240 }
241
242 // Test FAILURELATCH_IMPL_PROXY_OR_INFALLIBLE
243 {
244 class ProxyOrNull final : public mozilla::FailureLatch {
245 public:
246 ProxyOrNull() = default;
247
248 void Set(mozilla::FailureLatch* aFailureLatchOrNull) {
249 mFailureLatchOrNull = aFailureLatchOrNull;
250 }
251
252 FAILURELATCH_IMPL_PROXY_OR_INFALLIBLE(mFailureLatchOrNull, ProxyOrNull)[[nodiscard]] bool Fallible() const final { return mFailureLatchOrNull
? static_cast<const ::mozilla::FailureLatch*>(mFailureLatchOrNull
) ->Fallible() : false; } void SetFailure(std::string aReason
) final { if (mFailureLatchOrNull) { static_cast<::mozilla
::FailureLatch*>(mFailureLatchOrNull) ->SetFailure(std::
move(aReason)); } else { do { static_assert( mozilla::detail::
AssertionConditionType<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "SetFailure in infallible "
"ProxyOrNull" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 252); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "SetFailure in infallible " "ProxyOrNull" ")"); do { *
((volatile int*)__null) = 252; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false); } } [[nodiscard]] bool
Failed() const final { return mFailureLatchOrNull ? static_cast
<const ::mozilla::FailureLatch*>(mFailureLatchOrNull) ->
Failed() : false; } [[nodiscard]] const char* GetFailure() const
final { return mFailureLatchOrNull ? static_cast<const ::
mozilla::FailureLatch*>(mFailureLatchOrNull) ->GetFailure
() : nullptr; } [[nodiscard]] const FailureLatch& SourceFailureLatch
() const final { return mFailureLatchOrNull ? static_cast<
const ::mozilla::FailureLatch*>(mFailureLatchOrNull) ->
SourceFailureLatch() : ::mozilla::FailureLatchInfallibleSource
::Singleton(); } [[nodiscard]] FailureLatch& SourceFailureLatch
() final { return mFailureLatchOrNull ? static_cast<::mozilla
::FailureLatch*>(mFailureLatchOrNull) ->SourceFailureLatch
() : ::mozilla::FailureLatchInfallibleSource::Singleton(); }
253
254 private:
255 mozilla::FailureLatch* mFailureLatchOrNull = nullptr;
256 };
257
258 ProxyOrNull proxy;
259
260 MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 260); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()"
")"); do { *((volatile int*)__null) = 260; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
261 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 261); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 261; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
262 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 262); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 262; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
263 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 264; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
264 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 264; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
265 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 266); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 266; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
266 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 266); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 266; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
267
268 // Error from proxy.
269 {
270 mozilla::FailureLatchSource failureLatch;
271 proxy.Set(&failureLatch);
272 MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()"
")"); do { *((volatile int*)__null) = 272; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
273 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 273); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 273; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
274 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 274); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 274; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
275 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &failureLatch
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 275); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 275; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
276 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
277 &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
278
279 proxy.SetFailure("error");
280 MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 280); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()"
")"); do { *((volatile int*)__null) = 280; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
281 MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 281); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 281; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
282 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 282); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 282; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
283 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 283); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 283; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
284
285 // Don't forget to stop pointing at soon-to-be-destroyed object.
286 proxy.Set(nullptr);
287 }
288
289 // Error from proxy's origin.
290 {
291 mozilla::FailureLatchSource failureLatch;
292 proxy.Set(&failureLatch);
293 MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 293); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()"
")"); do { *((volatile int*)__null) = 293; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
294 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 294); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 294; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
295 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 295); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 295; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
296 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &failureLatch
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 296); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 296; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
297 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 298; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
298 &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
failureLatch)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch
() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch"
")"); do { *((volatile int*)__null) = 298; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
299
300 failureLatch.SetFailure("error");
301 MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 301); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()"
")"); do { *((volatile int*)__null) = 301; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
302 MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 302); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 302; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
303 MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(failureLatch.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 303); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()"
")"); do { *((volatile int*)__null) = 303; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
304 MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(strcmp(failureLatch.GetFailure(), "error") == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 304); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0"
")"); do { *((volatile int*)__null) = 304; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
305
306 // Don't forget to stop pointing at soon-to-be-destroyed object.
307 proxy.Set(nullptr);
308 }
309
310 MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 310); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()"
")"); do { *((volatile int*)__null) = 310; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
311 MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 311); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()"
")"); do { *((volatile int*)__null) = 311; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
312 MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 312); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()"
")"); do { *((volatile int*)__null) = 312; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
313 MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 314; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
314 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 314; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
315 MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 316; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
316 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(proxy).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(proxy).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 316; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
317 }
318
319 printf("TestFailureLatch done\n");
320}
321
322void TestProfilerUtils() {
323 printf("TestProfilerUtils...\n");
324
325 {
326 using mozilla::baseprofiler::BaseProfilerProcessId;
327 using Number = BaseProfilerProcessId::NumberType;
328 static constexpr Number scMaxNumber = std::numeric_limits<Number>::max();
329
330 static_assert(
331 BaseProfilerProcessId{}.ToNumber() == 0,
332 "These tests assume that the unspecified process id number is 0; "
333 "if this fails, please update these tests accordingly");
334
335 static_assert(!BaseProfilerProcessId{}.IsSpecified());
336 static_assert(!BaseProfilerProcessId::FromNumber(0).IsSpecified());
337 static_assert(BaseProfilerProcessId::FromNumber(1).IsSpecified());
338 static_assert(BaseProfilerProcessId::FromNumber(123).IsSpecified());
339 static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber).IsSpecified());
340
341 static_assert(BaseProfilerProcessId::FromNumber(Number(1)).ToNumber() ==
342 Number(1));
343 static_assert(BaseProfilerProcessId::FromNumber(Number(123)).ToNumber() ==
344 Number(123));
345 static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber).ToNumber() ==
346 scMaxNumber);
347
348 static_assert(BaseProfilerProcessId{} == BaseProfilerProcessId{});
349 static_assert(BaseProfilerProcessId::FromNumber(Number(123)) ==
350 BaseProfilerProcessId::FromNumber(Number(123)));
351 static_assert(BaseProfilerProcessId{} !=
352 BaseProfilerProcessId::FromNumber(Number(123)));
353 static_assert(BaseProfilerProcessId::FromNumber(Number(123)) !=
354 BaseProfilerProcessId{});
355 static_assert(BaseProfilerProcessId::FromNumber(Number(123)) !=
356 BaseProfilerProcessId::FromNumber(scMaxNumber));
357 static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber) !=
358 BaseProfilerProcessId::FromNumber(Number(123)));
359
360 // Verify trivial-copyability by memcpy'ing to&from same-size storage.
361 static_assert(std::is_trivially_copyable_v<BaseProfilerProcessId>);
362 BaseProfilerProcessId pid;
363 MOZ_RELEASE_ASSERT(!pid.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!pid.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!pid.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!pid.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid.IsSpecified()"
")"); do { *((volatile int*)__null) = 363; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
364 Number pidStorage;
365 static_assert(sizeof(pidStorage) == sizeof(pid));
366 // Copy from BaseProfilerProcessId to storage. Note: We cannot assume that
367 // this is equal to what ToNumber() gives us. All we can do is verify that
368 // copying from storage back to BaseProfilerProcessId works as expected.
369 std::memcpy(&pidStorage, &pid, sizeof(pidStorage));
370 BaseProfilerProcessId pid2 = BaseProfilerProcessId::FromNumber(2);
371 MOZ_RELEASE_ASSERT(pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(pid2.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("pid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 371); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 371; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
372 std::memcpy(&pid2, &pidStorage, sizeof(pid));
373 MOZ_RELEASE_ASSERT(!pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!pid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!pid2.IsSpecified()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!pid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 373); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 373; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
374
375 pid = BaseProfilerProcessId::FromNumber(123);
376 std::memcpy(&pidStorage, &pid, sizeof(pidStorage));
377 pid2 = BaseProfilerProcessId{};
378 MOZ_RELEASE_ASSERT(!pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!pid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!pid2.IsSpecified()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!pid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 378); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 378; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
379 std::memcpy(&pid2, &pidStorage, sizeof(pid));
380 MOZ_RELEASE_ASSERT(pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(pid2.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("pid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 380); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 380; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
381 MOZ_RELEASE_ASSERT(pid2.ToNumber() == 123)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pid2.ToNumber() == 123)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(pid2.ToNumber() == 123))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("pid2.ToNumber() == 123"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 381); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.ToNumber() == 123"
")"); do { *((volatile int*)__null) = 381; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
382
383 // No conversions to/from numbers.
384 static_assert(!std::is_constructible_v<BaseProfilerProcessId, Number>);
385 static_assert(!std::is_assignable_v<BaseProfilerProcessId, Number>);
386 static_assert(!std::is_constructible_v<Number, BaseProfilerProcessId>);
387 static_assert(!std::is_assignable_v<Number, BaseProfilerProcessId>);
388
389 static_assert(
390 std::is_same_v<
391 decltype(mozilla::baseprofiler::profiler_current_process_id()),
392 BaseProfilerProcessId>);
393 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_current_process_id()
.IsSpecified())>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::profiler_current_process_id
().IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::profiler_current_process_id().IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_current_process_id().IsSpecified()"
")"); do { *((volatile int*)__null) = 394; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
394 mozilla::baseprofiler::profiler_current_process_id().IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_current_process_id()
.IsSpecified())>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::profiler_current_process_id
().IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::profiler_current_process_id().IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_current_process_id().IsSpecified()"
")"); do { *((volatile int*)__null) = 394; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
395 }
396
397 {
398 mozilla::baseprofiler::profiler_init_main_thread_id();
399
400 using mozilla::baseprofiler::BaseProfilerThreadId;
401 using Number = BaseProfilerThreadId::NumberType;
402 static constexpr Number scMaxNumber = std::numeric_limits<Number>::max();
403
404 static_assert(
405 BaseProfilerThreadId{}.ToNumber() == 0,
406 "These tests assume that the unspecified thread id number is 0; "
407 "if this fails, please update these tests accordingly");
408
409 static_assert(!BaseProfilerThreadId{}.IsSpecified());
410 static_assert(!BaseProfilerThreadId::FromNumber(0).IsSpecified());
411 static_assert(BaseProfilerThreadId::FromNumber(1).IsSpecified());
412 static_assert(BaseProfilerThreadId::FromNumber(123).IsSpecified());
413 static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber).IsSpecified());
414
415 static_assert(BaseProfilerThreadId::FromNumber(Number(1)).ToNumber() ==
416 Number(1));
417 static_assert(BaseProfilerThreadId::FromNumber(Number(123)).ToNumber() ==
418 Number(123));
419 static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber).ToNumber() ==
420 scMaxNumber);
421
422 static_assert(BaseProfilerThreadId{} == BaseProfilerThreadId{});
423 static_assert(BaseProfilerThreadId::FromNumber(Number(123)) ==
424 BaseProfilerThreadId::FromNumber(Number(123)));
425 static_assert(BaseProfilerThreadId{} !=
426 BaseProfilerThreadId::FromNumber(Number(123)));
427 static_assert(BaseProfilerThreadId::FromNumber(Number(123)) !=
428 BaseProfilerThreadId{});
429 static_assert(BaseProfilerThreadId::FromNumber(Number(123)) !=
430 BaseProfilerThreadId::FromNumber(scMaxNumber));
431 static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber) !=
432 BaseProfilerThreadId::FromNumber(Number(123)));
433
434 // Verify trivial-copyability by memcpy'ing to&from same-size storage.
435 static_assert(std::is_trivially_copyable_v<BaseProfilerThreadId>);
436 BaseProfilerThreadId tid;
437 MOZ_RELEASE_ASSERT(!tid.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!tid.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!tid.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!tid.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 437); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid.IsSpecified()"
")"); do { *((volatile int*)__null) = 437; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
438 Number tidStorage;
439 static_assert(sizeof(tidStorage) == sizeof(tid));
440 // Copy from BaseProfilerThreadId to storage. Note: We cannot assume that
441 // this is equal to what ToNumber() gives us. All we can do is verify that
442 // copying from storage back to BaseProfilerThreadId works as expected.
443 std::memcpy(&tidStorage, &tid, sizeof(tidStorage));
444 BaseProfilerThreadId tid2 = BaseProfilerThreadId::FromNumber(2);
445 MOZ_RELEASE_ASSERT(tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tid2.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("tid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 445; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
446 std::memcpy(&tid2, &tidStorage, sizeof(tid));
447 MOZ_RELEASE_ASSERT(!tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!tid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!tid2.IsSpecified()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!tid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 447); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 447; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
448
449 tid = BaseProfilerThreadId::FromNumber(Number(123));
450 std::memcpy(&tidStorage, &tid, sizeof(tidStorage));
451 tid2 = BaseProfilerThreadId{};
452 MOZ_RELEASE_ASSERT(!tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!tid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!tid2.IsSpecified()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("!tid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 452); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 452; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
453 std::memcpy(&tid2, &tidStorage, sizeof(tid));
454 MOZ_RELEASE_ASSERT(tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tid2.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tid2.IsSpecified()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("tid2.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 454); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.IsSpecified()"
")"); do { *((volatile int*)__null) = 454; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
455 MOZ_RELEASE_ASSERT(tid2.ToNumber() == Number(123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tid2.ToNumber() == Number(123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tid2.ToNumber() == Number(123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("tid2.ToNumber() == Number(123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 455); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.ToNumber() == Number(123)"
")"); do { *((volatile int*)__null) = 455; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
456
457 // No conversions to/from numbers.
458 static_assert(!std::is_constructible_v<BaseProfilerThreadId, Number>);
459 static_assert(!std::is_assignable_v<BaseProfilerThreadId, Number>);
460 static_assert(!std::is_constructible_v<Number, BaseProfilerThreadId>);
461 static_assert(!std::is_assignable_v<Number, BaseProfilerThreadId>);
462
463 static_assert(std::is_same_v<
464 decltype(mozilla::baseprofiler::profiler_current_thread_id()),
465 BaseProfilerThreadId>);
466 BaseProfilerThreadId mainTestThreadId =
467 mozilla::baseprofiler::profiler_current_thread_id();
468 MOZ_RELEASE_ASSERT(mainTestThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mainTestThreadId.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mainTestThreadId.IsSpecified
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mainTestThreadId.IsSpecified()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 468); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainTestThreadId.IsSpecified()"
")"); do { *((volatile int*)__null) = 468; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
469
470 BaseProfilerThreadId mainThreadId =
471 mozilla::baseprofiler::profiler_main_thread_id();
472 MOZ_RELEASE_ASSERT(mainThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mainThreadId.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mainThreadId.IsSpecified()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mainThreadId.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 472); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId.IsSpecified()"
")"); do { *((volatile int*)__null) = 472; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
473
474 MOZ_RELEASE_ASSERT(mainThreadId == mainTestThreadId,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mainThreadId == mainTestThreadId)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mainThreadId == mainTestThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mainThreadId == mainTestThreadId" " (" "Test should run on the main thread"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId == mainTestThreadId"
") (" "Test should run on the main thread" ")"); do { *((volatile
int*)__null) = 475; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
475 "Test should run on the main thread")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mainThreadId == mainTestThreadId)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mainThreadId == mainTestThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mainThreadId == mainTestThreadId" " (" "Test should run on the main thread"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId == mainTestThreadId"
") (" "Test should run on the main thread" ")"); do { *((volatile
int*)__null) = 475; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
476 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_is_main_thread())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_is_main_thread()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::profiler_is_main_thread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_is_main_thread()"
")"); do { *((volatile int*)__null) = 476; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
477
478 std::thread testThread([&]() {
479 const BaseProfilerThreadId testThreadId =
480 mozilla::baseprofiler::profiler_current_thread_id();
481 MOZ_RELEASE_ASSERT(testThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(testThreadId.IsSpecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(testThreadId.IsSpecified()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("testThreadId.IsSpecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 481); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId.IsSpecified()"
")"); do { *((volatile int*)__null) = 481; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
482 MOZ_RELEASE_ASSERT(testThreadId != mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(testThreadId != mainThreadId)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(testThreadId != mainThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"testThreadId != mainThreadId", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 482); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId != mainThreadId"
")"); do { *((volatile int*)__null) = 482; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
483 MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_is_main_thread())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_is_main_thread())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_is_main_thread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_is_main_thread()"
")"); do { *((volatile int*)__null) = 483; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
484 });
485 testThread.join();
486 }
487
488 // No conversions between processes and threads.
489 static_assert(
490 !std::is_constructible_v<mozilla::baseprofiler::BaseProfilerThreadId,
491 mozilla::baseprofiler::BaseProfilerProcessId>);
492 static_assert(
493 !std::is_assignable_v<mozilla::baseprofiler::BaseProfilerThreadId,
494 mozilla::baseprofiler::BaseProfilerProcessId>);
495 static_assert(
496 !std::is_constructible_v<mozilla::baseprofiler::BaseProfilerProcessId,
497 mozilla::baseprofiler::BaseProfilerThreadId>);
498 static_assert(
499 !std::is_assignable_v<mozilla::baseprofiler::BaseProfilerProcessId,
500 mozilla::baseprofiler::BaseProfilerThreadId>);
501
502 printf("TestProfilerUtils done\n");
503}
504
505void TestBaseAndProfilerDetail() {
506 printf("TestBaseAndProfilerDetail...\n");
507
508 {
509 using mozilla::profiler::detail::FilterHasPid;
510
511 const auto pid123 =
512 mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(123);
513 MOZ_RELEASE_ASSERT(FilterHasPid("pid:123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(FilterHasPid("pid:123", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(FilterHasPid("pid:123", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("FilterHasPid(\"pid:123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 513); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FilterHasPid(\"pid:123\", pid123)"
")"); do { *((volatile int*)__null) = 513; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
514 MOZ_RELEASE_ASSERT(!FilterHasPid("", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("", pid123))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(\"\", pid123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 514); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"\", pid123)"
")"); do { *((volatile int*)__null) = 514; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
515 MOZ_RELEASE_ASSERT(!FilterHasPid(" ", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid(" ", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid(" ", pid123)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(\" \", pid123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 515); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\" \", pid123)"
")"); do { *((volatile int*)__null) = 515; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
516 MOZ_RELEASE_ASSERT(!FilterHasPid("123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("123", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("123", pid123)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!FilterHasPid(\"123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"123\", pid123)"
")"); do { *((volatile int*)__null) = 516; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
517 MOZ_RELEASE_ASSERT(!FilterHasPid("pid", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid", pid123)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!FilterHasPid(\"pid\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 517); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid\", pid123)"
")"); do { *((volatile int*)__null) = 517; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
518 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 518); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:\", pid123)"
")"); do { *((volatile int*)__null) = 518; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
519 MOZ_RELEASE_ASSERT(!FilterHasPid("pid=123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid=123", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid=123", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid=123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 519); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid=123\", pid123)"
")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
520 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:123 ", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:123 ", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:123 ", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:123 \", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:123 \", pid123)"
")"); do { *((volatile int*)__null) = 520; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
521 MOZ_RELEASE_ASSERT(!FilterHasPid("pid: 123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid: 123", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid: 123", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid: 123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 521); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid: 123\", pid123)"
")"); do { *((volatile int*)__null) = 521; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
522 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:0123", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:0123", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:0123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 522); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0123\", pid123)"
")"); do { *((volatile int*)__null) = 522; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
523 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0000000000000000000000123", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:0000000000000000000000123", pid123
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!FilterHasPid("pid:0000000000000000000000123", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:0000000000000000000000123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0000000000000000000000123\", pid123)"
")"); do { *((volatile int*)__null) = 523; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
524 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:12", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:12", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:12", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:12\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 524); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:12\", pid123)"
")"); do { *((volatile int*)__null) = 524; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
525 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:1234", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:1234", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:1234", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:1234\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 525); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:1234\", pid123)"
")"); do { *((volatile int*)__null) = 525; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
526 MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0", pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid("pid:0", pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:0", pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FilterHasPid(\"pid:0\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 526); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0\", pid123)"
")"); do { *((volatile int*)__null) = 526; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
527
528 using PidNumber = mozilla::baseprofiler::BaseProfilerProcessId::NumberType;
529 const PidNumber maxNumber = std::numeric_limits<PidNumber>::max();
530 const auto maxPid =
531 mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(maxNumber);
532 const std::string maxPidString = "pid:" + std::to_string(maxNumber);
533 MOZ_RELEASE_ASSERT(FilterHasPid(maxPidString.c_str(), maxPid))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(FilterHasPid(maxPidString.c_str(), maxPid))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(FilterHasPid(maxPidString.c_str(), maxPid)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("FilterHasPid(maxPidString.c_str(), maxPid)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 533); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FilterHasPid(maxPidString.c_str(), maxPid)"
")"); do { *((volatile int*)__null) = 533; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
534
535 const std::string tooBigPidString = maxPidString + "0";
536 MOZ_RELEASE_ASSERT(!FilterHasPid(tooBigPidString.c_str(), maxPid))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FilterHasPid(tooBigPidString.c_str(), maxPid))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!FilterHasPid(tooBigPidString.c_str(), maxPid)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(tooBigPidString.c_str(), maxPid)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 536); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(tooBigPidString.c_str(), maxPid)"
")"); do { *((volatile int*)__null) = 536; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
537 }
538
539 {
540 using mozilla::profiler::detail::FiltersExcludePid;
541 const auto pid123 =
542 mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(123);
543
544 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(mozilla::Span<const char*>{
}, pid123))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(!FiltersExcludePid(mozilla::Span<
const char*>{}, pid123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)"
")"); do { *((volatile int*)__null) = 545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
545 !FiltersExcludePid(mozilla::Span<const char*>{}, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(mozilla::Span<const char*>{
}, pid123))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(!FiltersExcludePid(mozilla::Span<
const char*>{}, pid123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)"
")"); do { *((volatile int*)__null) = 545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
546
547 {
548 const char* const filters[] = {"main"};
549 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 549); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 549; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
550 }
551
552 {
553 const char* const filters[] = {"main", "pid:123"};
554 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 554); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 554; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
555 }
556
557 {
558 const char* const filters[] = {"main", "pid:456"};
559 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 559; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
560 }
561
562 {
563 const char* const filters[] = {"pid:123"};
564 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 564); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 564; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
565 }
566
567 {
568 const char* const filters[] = {"pid:123", "pid:456"};
569 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 569; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
570 }
571
572 {
573 const char* const filters[] = {"pid:456", "pid:123"};
574 MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 574); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 574; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
575 }
576
577 {
578 const char* const filters[] = {"pid:456"};
579 MOZ_RELEASE_ASSERT(FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 579); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 579; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
580 }
581
582 {
583 const char* const filters[] = {"pid:456", "pid:789"};
584 MOZ_RELEASE_ASSERT(FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(FiltersExcludePid(filters, pid123
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 584); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FiltersExcludePid(filters, pid123)"
")"); do { *((volatile int*)__null) = 584; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
585 }
586 }
587
588 printf("TestBaseAndProfilerDetail done\n");
589}
590
591void TestSharedMutex() {
592 printf("TestSharedMutex...\n");
593
594 mozilla::baseprofiler::detail::BaseProfilerSharedMutex sm;
595
596 // First round of minimal tests in this thread.
597
598 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 598); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 598; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
599
600 sm.LockExclusive();
601 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 601; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
602 sm.UnlockExclusive();
603 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 603); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 603; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
604
605 sm.LockShared();
606 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 606); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 606; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
607 sm.UnlockShared();
608 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
609
610 {
611 mozilla::baseprofiler::detail::BaseProfilerAutoLockExclusive exclusiveLock{
612 sm};
613 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 613); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 613; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
614 }
615 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 615; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
616
617 {
618 mozilla::baseprofiler::detail::BaseProfilerAutoLockShared sharedLock{sm};
619 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 619; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
620 }
621 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 621); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 621; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
622
623 // The following will run actions between two threads, to verify that
624 // exclusive and shared locks work as expected.
625
626 // These actions will happen from top to bottom.
627 // This will test all possible lock interactions.
628 enum NextAction { // State of the lock:
629 t1Starting, // (x=exclusive, s=shared, ?=blocked)
630 t2Starting, // t1 t2
631 t1LockExclusive, // x
632 t2LockExclusiveAndBlock, // x x? - Can't have two exclusives.
633 t1UnlockExclusive, // x
634 t2UnblockedAfterT1Unlock, // x
635 t1LockSharedAndBlock, // s? x - Can't have shared during excl
636 t2UnlockExclusive, // s
637 t1UnblockedAfterT2Unlock, // s
638 t2LockShared, // s s - Can have multiple shared locks
639 t1UnlockShared, // s
640 t2StillLockedShared, // s
641 t1LockExclusiveAndBlock, // x? s - Can't have excl during shared
642 t2UnlockShared, // x
643 t1UnblockedAfterT2UnlockShared, // x
644 t2CheckAfterT1Lock, // x
645 t1LastUnlockExclusive, // (unlocked)
646 done
647 };
648
649 // Each thread will repeatedly read this `nextAction`, and run actions that
650 // target it...
651 std::atomic<NextAction> nextAction{static_cast<NextAction>(0)};
652 // ... and advance to the next available action (which should usually be for
653 // the other thread).
654 auto AdvanceAction = [&nextAction]() {
655 MOZ_RELEASE_ASSERT(nextAction <= done)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(nextAction <= done)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(nextAction <= done))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("nextAction <= done"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction <= done"
")"); do { *((volatile int*)__null) = 655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
656 nextAction = static_cast<NextAction>(static_cast<int>(nextAction) + 1);
657 };
658
659 std::thread t1{[&]() {
660 for (;;) {
661 switch (nextAction) {
662 case t1Starting:
663 AdvanceAction();
664 break;
665 case t1LockExclusive:
666 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 666; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
667 sm.LockExclusive();
668 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 668); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 668; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
669 AdvanceAction();
670 break;
671 case t1UnlockExclusive:
672 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
673 // Advance first, before unlocking, so that t2 sees the new state.
674 AdvanceAction();
675 sm.UnlockExclusive();
676 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 676); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 676; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
677 break;
678 case t1LockSharedAndBlock:
679 // Advance action before attempting to lock after t2's exclusive lock.
680 AdvanceAction();
681 sm.LockShared();
682 // We will only acquire the lock after t1 unlocks.
683 MOZ_RELEASE_ASSERT(nextAction == t1UnblockedAfterT2Unlock)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(nextAction == t1UnblockedAfterT2Unlock)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(nextAction == t1UnblockedAfterT2Unlock))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("nextAction == t1UnblockedAfterT2Unlock"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t1UnblockedAfterT2Unlock"
")"); do { *((volatile int*)__null) = 683; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
684 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
685 AdvanceAction();
686 break;
687 case t1UnlockShared:
688 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 688); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 688; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
689 // Advance first, before unlocking, so that t2 sees the new state.
690 AdvanceAction();
691 sm.UnlockShared();
692 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 692); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 692; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
693 break;
694 case t1LockExclusiveAndBlock:
695 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
696 // Advance action before attempting to lock after t2's shared lock.
697 AdvanceAction();
698 sm.LockExclusive();
699 // We will only acquire the lock after t2 unlocks.
700 MOZ_RELEASE_ASSERT(nextAction == t1UnblockedAfterT2UnlockShared)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(nextAction == t1UnblockedAfterT2UnlockShared)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(nextAction == t1UnblockedAfterT2UnlockShared))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("nextAction == t1UnblockedAfterT2UnlockShared"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t1UnblockedAfterT2UnlockShared"
")"); do { *((volatile int*)__null) = 700; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
701 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 701; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
702 AdvanceAction();
703 break;
704 case t1LastUnlockExclusive:
705 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 705); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 705; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
706 // Advance first, before unlocking, so that t2 sees the new state.
707 AdvanceAction();
708 sm.UnlockExclusive();
709 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 709); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 709; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
710 break;
711 case done:
712 return;
713 default:
714 // Ignore other actions intended for t2.
715 break;
716 }
717 }
718 }};
719
720 std::thread t2{[&]() {
721 for (;;) {
722 switch (nextAction) {
723 case t2Starting:
724 AdvanceAction();
725 break;
726 case t2LockExclusiveAndBlock:
727 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 727); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 727; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
728 // Advance action before attempting to lock after t1's exclusive lock.
729 AdvanceAction();
730 sm.LockExclusive();
731 // We will only acquire the lock after t1 unlocks.
732 MOZ_RELEASE_ASSERT(nextAction == t2UnblockedAfterT1Unlock)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(nextAction == t2UnblockedAfterT1Unlock)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(nextAction == t2UnblockedAfterT1Unlock))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("nextAction == t2UnblockedAfterT1Unlock"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 732); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t2UnblockedAfterT1Unlock"
")"); do { *((volatile int*)__null) = 732; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
733 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
734 AdvanceAction();
735 break;
736 case t2UnlockExclusive:
737 MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 737); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 737; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
738 // Advance first, before unlocking, so that t1 sees the new state.
739 AdvanceAction();
740 sm.UnlockExclusive();
741 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 741); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 741; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
742 break;
743 case t2LockShared:
744 sm.LockShared();
745 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
746 AdvanceAction();
747 break;
748 case t2StillLockedShared:
749 AdvanceAction();
750 break;
751 case t2UnlockShared:
752 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 752); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 752; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
753 // Advance first, before unlocking, so that t1 sees the new state.
754 AdvanceAction();
755 sm.UnlockShared();
756 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 756); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 756; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
757 break;
758 case t2CheckAfterT1Lock:
759 MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()"
")"); do { *((volatile int*)__null) = 759; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
760 AdvanceAction();
761 break;
762 case done:
763 return;
764 default:
765 // Ignore other actions intended for t1.
766 break;
767 }
768 }
769 }};
770
771 t1.join();
772 t2.join();
773
774 printf("TestSharedMutex done\n");
775}
776
777void TestProportionValue() {
778 printf("TestProportionValue...\n");
779
780 using mozilla::ProportionValue;
781
782#define STATIC_ASSERT_EQ(a, b) \
783 static_assert((a) == (b)); \
784 MOZ_RELEASE_ASSERT((a) == (b))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((a) == (b))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((a) == (b)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(a) == (b)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(a) == (b)"
")"); do { *((volatile int*)__null) = 784; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
785
786#define STATIC_ASSERT(e)STATIC_ASSERT_EQ(e, true) STATIC_ASSERT_EQ(e, true)
787
788 // Conversion from&to double.
789 STATIC_ASSERT_EQ(ProportionValue().ToDouble(), 0.0);
790 STATIC_ASSERT_EQ(ProportionValue(0.0).ToDouble(), 0.0);
791 STATIC_ASSERT_EQ(ProportionValue(0.5).ToDouble(), 0.5);
792 STATIC_ASSERT_EQ(ProportionValue(1.0).ToDouble(), 1.0);
793
794 // Clamping.
795 STATIC_ASSERT_EQ(
796 ProportionValue(std::numeric_limits<double>::min()).ToDouble(), 0.0);
797 STATIC_ASSERT_EQ(
798 ProportionValue(std::numeric_limits<long double>::min()).ToDouble(), 0.0);
799 STATIC_ASSERT_EQ(ProportionValue(-1.0).ToDouble(), 0.0);
800 STATIC_ASSERT_EQ(ProportionValue(-0.01).ToDouble(), 0.0);
801 STATIC_ASSERT_EQ(ProportionValue(-0.0).ToDouble(), 0.0);
802 STATIC_ASSERT_EQ(ProportionValue(1.01).ToDouble(), 1.0);
803 STATIC_ASSERT_EQ(
804 ProportionValue(std::numeric_limits<double>::max()).ToDouble(), 1.0);
805
806 // User-defined literal.
807 {
808 using namespace mozilla::literals::ProportionValue_literals;
809 STATIC_ASSERT_EQ(0_pc, ProportionValue(0.0));
810 STATIC_ASSERT_EQ(0._pc, ProportionValue(0.0));
811 STATIC_ASSERT_EQ(50_pc, ProportionValue(0.5));
812 STATIC_ASSERT_EQ(50._pc, ProportionValue(0.5));
813 STATIC_ASSERT_EQ(100_pc, ProportionValue(1.0));
814 STATIC_ASSERT_EQ(100._pc, ProportionValue(1.0));
815 STATIC_ASSERT_EQ(101_pc, ProportionValue(1.0));
816 STATIC_ASSERT_EQ(100.01_pc, ProportionValue(1.0));
817 STATIC_ASSERT_EQ(1000_pc, ProportionValue(1.0));
818 STATIC_ASSERT_EQ(1000._pc, ProportionValue(1.0));
819 }
820 {
821 // ProportionValue_literals is an inline namespace of mozilla::literals, so
822 // it's optional.
823 using namespace mozilla::literals;
824 STATIC_ASSERT_EQ(0_pc, ProportionValue(0.0));
825 STATIC_ASSERT_EQ(0._pc, ProportionValue(0.0));
826 STATIC_ASSERT_EQ(50_pc, ProportionValue(0.5));
827 STATIC_ASSERT_EQ(50._pc, ProportionValue(0.5));
828 STATIC_ASSERT_EQ(100_pc, ProportionValue(1.0));
829 STATIC_ASSERT_EQ(100._pc, ProportionValue(1.0));
830 STATIC_ASSERT_EQ(101_pc, ProportionValue(1.0));
831 STATIC_ASSERT_EQ(100.01_pc, ProportionValue(1.0));
832 STATIC_ASSERT_EQ(1000_pc, ProportionValue(1.0));
833 STATIC_ASSERT_EQ(1000._pc, ProportionValue(1.0));
834 }
835
836 // Invalid construction, conversion to double NaN.
837 MOZ_RELEASE_ASSERT(std::isnan(ProportionValue::MakeInvalid().ToDouble()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(std::isnan(ProportionValue::MakeInvalid().ToDouble()
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(std::isnan(ProportionValue::MakeInvalid().ToDouble()
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("std::isnan(ProportionValue::MakeInvalid().ToDouble())", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 837); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "std::isnan(ProportionValue::MakeInvalid().ToDouble())"
")"); do { *((volatile int*)__null) = 837; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
838
839 using namespace mozilla::literals::ProportionValue_literals;
840
841 // Conversion to&from underlying integral number.
842 STATIC_ASSERT_EQ(
843 ProportionValue::FromUnderlyingType((0_pc).ToUnderlyingType()).ToDouble(),
844 0.0);
845 STATIC_ASSERT_EQ(
846 ProportionValue::FromUnderlyingType((50_pc).ToUnderlyingType())
847 .ToDouble(),
848 0.5);
849 STATIC_ASSERT_EQ(
850 ProportionValue::FromUnderlyingType((100_pc).ToUnderlyingType())
851 .ToDouble(),
852 1.0);
853 STATIC_ASSERT(ProportionValue::FromUnderlyingType(STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue
::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true)
854 ProportionValue::MakeInvalid().ToUnderlyingType())STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue
::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true)
855 .IsInvalid())STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue
::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true)
;
856
857 // IsExactlyZero.
858 STATIC_ASSERT(ProportionValue().IsExactlyZero())STATIC_ASSERT_EQ(ProportionValue().IsExactlyZero(), true);
859 STATIC_ASSERT((0_pc).IsExactlyZero())STATIC_ASSERT_EQ((0_pc).IsExactlyZero(), true);
860 STATIC_ASSERT(!(50_pc).IsExactlyZero())STATIC_ASSERT_EQ(!(50_pc).IsExactlyZero(), true);
861 STATIC_ASSERT(!(100_pc).IsExactlyZero())STATIC_ASSERT_EQ(!(100_pc).IsExactlyZero(), true);
862 STATIC_ASSERT(!ProportionValue::MakeInvalid().IsExactlyZero())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsExactlyZero
(), true)
;
863
864 // IsExactlyOne.
865 STATIC_ASSERT(!ProportionValue().IsExactlyOne())STATIC_ASSERT_EQ(!ProportionValue().IsExactlyOne(), true);
866 STATIC_ASSERT(!(0_pc).IsExactlyOne())STATIC_ASSERT_EQ(!(0_pc).IsExactlyOne(), true);
867 STATIC_ASSERT(!(50_pc).IsExactlyOne())STATIC_ASSERT_EQ(!(50_pc).IsExactlyOne(), true);
868 STATIC_ASSERT((100_pc).IsExactlyOne())STATIC_ASSERT_EQ((100_pc).IsExactlyOne(), true);
869 STATIC_ASSERT(!ProportionValue::MakeInvalid().IsExactlyOne())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsExactlyOne
(), true)
;
870
871 // IsValid.
872 STATIC_ASSERT(ProportionValue().IsValid())STATIC_ASSERT_EQ(ProportionValue().IsValid(), true);
873 STATIC_ASSERT((0_pc).IsValid())STATIC_ASSERT_EQ((0_pc).IsValid(), true);
874 STATIC_ASSERT((50_pc).IsValid())STATIC_ASSERT_EQ((50_pc).IsValid(), true);
875 STATIC_ASSERT((100_pc).IsValid())STATIC_ASSERT_EQ((100_pc).IsValid(), true);
876 STATIC_ASSERT(!ProportionValue::MakeInvalid().IsValid())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsValid(), true
)
;
877
878 // IsInvalid.
879 STATIC_ASSERT(!ProportionValue().IsInvalid())STATIC_ASSERT_EQ(!ProportionValue().IsInvalid(), true);
880 STATIC_ASSERT(!(0_pc).IsInvalid())STATIC_ASSERT_EQ(!(0_pc).IsInvalid(), true);
881 STATIC_ASSERT(!(50_pc).IsInvalid())STATIC_ASSERT_EQ(!(50_pc).IsInvalid(), true);
882 STATIC_ASSERT(!(100_pc).IsInvalid())STATIC_ASSERT_EQ(!(100_pc).IsInvalid(), true);
883 STATIC_ASSERT(ProportionValue::MakeInvalid().IsInvalid())STATIC_ASSERT_EQ(ProportionValue::MakeInvalid().IsInvalid(), true
)
;
884
885 // Addition.
886 STATIC_ASSERT_EQ((0_pc + 0_pc).ToDouble(), 0.0);
887 STATIC_ASSERT_EQ((0_pc + 100_pc).ToDouble(), 1.0);
888 STATIC_ASSERT_EQ((100_pc + 0_pc).ToDouble(), 1.0);
889 STATIC_ASSERT_EQ((100_pc + 100_pc).ToDouble(), 1.0);
890 STATIC_ASSERT((ProportionValue::MakeInvalid() + 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() + 50_pc).IsInvalid
(), true)
;
891 STATIC_ASSERT((50_pc + ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc + ProportionValue::MakeInvalid()).IsInvalid
(), true)
;
892
893 // Subtraction.
894 STATIC_ASSERT_EQ((0_pc - 0_pc).ToDouble(), 0.0);
895 STATIC_ASSERT_EQ((0_pc - 100_pc).ToDouble(), 0.0);
896 STATIC_ASSERT_EQ((100_pc - 0_pc).ToDouble(), 1.0);
897 STATIC_ASSERT_EQ((100_pc - 100_pc).ToDouble(), 0.0);
898 STATIC_ASSERT((ProportionValue::MakeInvalid() - 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() - 50_pc).IsInvalid
(), true)
;
899 STATIC_ASSERT((50_pc - ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc - ProportionValue::MakeInvalid()).IsInvalid
(), true)
;
900
901 // Multiplication.
902 STATIC_ASSERT_EQ((0_pc * 0_pc).ToDouble(), 0.0);
903 STATIC_ASSERT_EQ((0_pc * 100_pc).ToDouble(), 0.0);
904 STATIC_ASSERT_EQ((50_pc * 50_pc).ToDouble(), 0.25);
905 STATIC_ASSERT_EQ((50_pc * 100_pc).ToDouble(), 0.5);
906 STATIC_ASSERT_EQ((100_pc * 50_pc).ToDouble(), 0.5);
907 STATIC_ASSERT_EQ((100_pc * 0_pc).ToDouble(), 0.0);
908 STATIC_ASSERT_EQ((100_pc * 100_pc).ToDouble(), 1.0);
909 STATIC_ASSERT((ProportionValue::MakeInvalid() * 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() * 50_pc).IsInvalid
(), true)
;
910 STATIC_ASSERT((50_pc * ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc * ProportionValue::MakeInvalid()).IsInvalid
(), true)
;
911
912 // Division by a positive integer value.
913 STATIC_ASSERT_EQ((100_pc / 1u).ToDouble(), 1.0);
914 STATIC_ASSERT_EQ((100_pc / 2u).ToDouble(), 0.5);
915 STATIC_ASSERT_EQ(
916 (ProportionValue::FromUnderlyingType(6u) / 2u).ToUnderlyingType(), 3u);
917 STATIC_ASSERT_EQ(
918 (ProportionValue::FromUnderlyingType(5u) / 2u).ToUnderlyingType(), 2u);
919 STATIC_ASSERT_EQ(
920 (ProportionValue::FromUnderlyingType(1u) / 2u).ToUnderlyingType(), 0u);
921 STATIC_ASSERT_EQ(
922 (ProportionValue::FromUnderlyingType(0u) / 2u).ToUnderlyingType(), 0u);
923 STATIC_ASSERT((100_pc / 0u).IsInvalid())STATIC_ASSERT_EQ((100_pc / 0u).IsInvalid(), true);
924 STATIC_ASSERT((ProportionValue::MakeInvalid() / 2u).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() / 2u).IsInvalid
(), true)
;
925
926 // Multiplication by a positive integer value.
927 STATIC_ASSERT_EQ((100_pc * 1u).ToDouble(), 1.0);
928 STATIC_ASSERT_EQ((50_pc * 1u).ToDouble(), 0.5);
929 STATIC_ASSERT_EQ((50_pc * 2u).ToDouble(), 1.0);
930 STATIC_ASSERT_EQ((50_pc * 3u).ToDouble(), 1.0); // Clamped.
931 STATIC_ASSERT_EQ(
932 (ProportionValue::FromUnderlyingType(1u) * 2u).ToUnderlyingType(), 2u);
933 STATIC_ASSERT((ProportionValue::MakeInvalid() * 2u).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() * 2u).IsInvalid
(), true)
;
934
935 // Verifying PV - u < (PV / u) * u <= PV, with n=3, PV between 6 and 9 :
936 STATIC_ASSERT_EQ(
937 (ProportionValue::FromUnderlyingType(6u) / 3u).ToUnderlyingType(), 2u);
938 STATIC_ASSERT_EQ(
939 (ProportionValue::FromUnderlyingType(7u) / 3u).ToUnderlyingType(), 2u);
940 STATIC_ASSERT_EQ(
941 (ProportionValue::FromUnderlyingType(8u) / 3u).ToUnderlyingType(), 2u);
942 STATIC_ASSERT_EQ(
943 (ProportionValue::FromUnderlyingType(9u) / 3u).ToUnderlyingType(), 3u);
944
945 // Direct comparisons.
946 STATIC_ASSERT_EQ(0_pc, 0_pc);
947 STATIC_ASSERT(0_pc == 0_pc)STATIC_ASSERT_EQ(0_pc == 0_pc, true);
948 STATIC_ASSERT(!(0_pc == 100_pc))STATIC_ASSERT_EQ(!(0_pc == 100_pc), true);
949 STATIC_ASSERT(0_pc != 100_pc)STATIC_ASSERT_EQ(0_pc != 100_pc, true);
950 STATIC_ASSERT(!(0_pc != 0_pc))STATIC_ASSERT_EQ(!(0_pc != 0_pc), true);
951 STATIC_ASSERT(0_pc < 100_pc)STATIC_ASSERT_EQ(0_pc < 100_pc, true);
952 STATIC_ASSERT(!(0_pc < 0_pc))STATIC_ASSERT_EQ(!(0_pc < 0_pc), true);
953 STATIC_ASSERT(0_pc <= 0_pc)STATIC_ASSERT_EQ(0_pc <= 0_pc, true);
954 STATIC_ASSERT(0_pc <= 100_pc)STATIC_ASSERT_EQ(0_pc <= 100_pc, true);
955 STATIC_ASSERT(!(100_pc <= 0_pc))STATIC_ASSERT_EQ(!(100_pc <= 0_pc), true);
956 STATIC_ASSERT(100_pc > 0_pc)STATIC_ASSERT_EQ(100_pc > 0_pc, true);
957 STATIC_ASSERT(!(100_pc > 100_pc))STATIC_ASSERT_EQ(!(100_pc > 100_pc), true);
958 STATIC_ASSERT(100_pc >= 0_pc)STATIC_ASSERT_EQ(100_pc >= 0_pc, true);
959 STATIC_ASSERT(100_pc >= 100_pc)STATIC_ASSERT_EQ(100_pc >= 100_pc, true);
960 STATIC_ASSERT(!(0_pc >= 100_pc))STATIC_ASSERT_EQ(!(0_pc >= 100_pc), true);
961 // 0.5 is binary-friendly, so we can double it and compare it exactly.
962 STATIC_ASSERT_EQ(50_pc + 50_pc, 100_pc);
963
964#undef STATIC_ASSERT_EQ
965
966 printf("TestProportionValue done\n");
967}
968
969template <typename Arg0, typename... Args>
970bool AreAllEqual(Arg0&& aArg0, Args&&... aArgs) {
971 return ((aArg0 == aArgs) && ...);
972}
973
974void TestProgressLogger() {
975 printf("TestProgressLogger...\n");
976
977 using mozilla::ProgressLogger;
978 using mozilla::ProportionValue;
979 using namespace mozilla::literals::ProportionValue_literals;
980
981 auto progressRefPtr = mozilla::MakeRefPtr<ProgressLogger::SharedProgress>();
982 MOZ_RELEASE_ASSERT(progressRefPtr)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(progressRefPtr))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("progressRefPtr"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 982); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr"
")"); do { *((volatile int*)__null) = 982; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
983 MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr->Progress().IsExactlyZero())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 983); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 983; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
984
985 {
986 ProgressLogger pl(progressRefPtr, "Started", "All done");
987 MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr->Progress().IsExactlyZero())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 987); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 987; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
988 MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pl.GetGlobalProgress().IsExactlyZero())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(pl.GetGlobalProgress().IsExactlyZero()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 988); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 988; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
989 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Started"))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Started")))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 990); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")"
")"); do { *((volatile int*)__null) = 990; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
990 pl.GetLastGlobalLocation(), "Started"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Started"))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Started")))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 990); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")"
")"); do { *((volatile int*)__null) = 990; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
991
992 // At this top level, the scale is 1:1.
993 pl.SetLocalProgress(10_pc, "Top 10%");
994 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), 10_pc))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress
(), pl.GetGlobalProgress(), 10_pc)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)"
")"); do { *((volatile int*)__null) = 995; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
995 AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), 10_pc))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress
(), pl.GetGlobalProgress(), 10_pc)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)"
")"); do { *((volatile int*)__null) = 995; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
996 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Top 10%"))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Top 10%")))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 997); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")"
")"); do { *((volatile int*)__null) = 997; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
997 pl.GetLastGlobalLocation(), "Top 10%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Top 10%"))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Top 10%")))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 997); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")"
")"); do { *((volatile int*)__null) = 997; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
998
999 pl.SetLocalProgress(0_pc, "Restarted");
1000 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), 0_pc))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress
(), pl.GetGlobalProgress(), 0_pc)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1001); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)"
")"); do { *((volatile int*)__null) = 1001; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1001 AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), 0_pc))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress
(), pl.GetGlobalProgress(), 0_pc)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1001); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)"
")"); do { *((volatile int*)__null) = 1001; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1002 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Restarted"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Restarted")))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")"
")"); do { *((volatile int*)__null) = 1003; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1003 pl.GetLastGlobalLocation(), "Restarted"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Restarted"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Restarted")))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")"
")"); do { *((volatile int*)__null) = 1003; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1004
1005 {
1006 // Create a sub-logger for the whole global range. Notice that this is
1007 // moving the current progress back to 0.
1008 ProgressLogger plSub1 =
1009 pl.CreateSubLoggerFromTo(0_pc, "Sub1 started", 100_pc, "Sub1 ended");
1010 MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr->Progress().IsExactlyZero())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1010); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 1010; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1011 MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pl.GetGlobalProgress().IsExactlyZero())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(pl.GetGlobalProgress().IsExactlyZero()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1011); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 1011; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1012 MOZ_RELEASE_ASSERT(plSub1.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(plSub1.GetGlobalProgress().IsExactlyZero())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(plSub1.GetGlobalProgress().IsExactlyZero()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("plSub1.GetGlobalProgress().IsExactlyZero()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1012); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "plSub1.GetGlobalProgress().IsExactlyZero()"
")"); do { *((volatile int*)__null) = 1012; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1013 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1014 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1015 plSub1.GetLastGlobalLocation(), "Sub1 started"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")"
")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1016
1017 // At this level, the scale is still 1:1.
1018 plSub1.SetLocalProgress(10_pc, "Sub1 10%");
1019 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1020 pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1021 plSub1.GetGlobalProgress(), 10_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)"
")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1022 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1023 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1024 plSub1.GetLastGlobalLocation(), "Sub1 10%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")"
")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1025
1026 {
1027 // Create a sub-logger half the global range.
1028 // 0 0.25 0.375 0.5 0.625 0.75 1
1029 // |---------------|-------|-------|-------|-------|---------------|
1030 // plSub2: 0 0.25 0.5 0.75 1
1031 ProgressLogger plSub2 = plSub1.CreateSubLoggerFromTo(
1032 25_pc, "Sub2 started", 75_pc, "Sub2 ended");
1033 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1034 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1035 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)"
")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1036 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 started"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1037 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 started"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1038 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 started"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1039 "Sub2 started"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 started"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")"
")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1040
1041 plSub2.SetLocalProgress(25_pc, "Sub2 25%");
1042 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1043 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1044 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)"
")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1045 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 25%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1046 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 25%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1047 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 25%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1048 "Sub2 25%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 25%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")"
")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1049
1050 plSub2.SetLocalProgress(50_pc, "Sub2 50%");
1051 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1052 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1053 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1054 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1055 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1056 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1057 "Sub2 50%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub2 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")"
")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1058
1059 {
1060 // Create a sub-logger half the parent range.
1061 // 0 0.25 0.375 0.5 0.625 0.75 1
1062 // |---------------|-------|-------|-------|-------|---------------|
1063 // plSub2: 0 0.25 0.5 0.75 1
1064 // plSub3: 0 0.5 1
1065 ProgressLogger plSub3 = plSub2.CreateSubLoggerTo(
1066 "Sub3 started", 100_pc, ProgressLogger::NO_LOCATION_UPDATE);
1067 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1068 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1069 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1070 plSub3.GetGlobalProgress(), 50_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)"
")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1071 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1072 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1073 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1074 plSub3.GetLastGlobalLocation(), "Sub3 started"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")"
")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1075
1076 plSub3.SetLocalProgress(50_pc, "Sub3 50%");
1077 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1078 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1079 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1080 plSub3.GetGlobalProgress(), 62.5_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3
.GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)"
")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1081 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1082 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1083 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1084 plSub3.GetLastGlobalLocation(), "Sub3 50%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1085 } // End of plSub3
1086
1087 // When plSub3 ends, progress moves to its 100%, which is also plSub2's
1088 // 100%, which is plSub1's and the global progress of 75%
1089 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1090 progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1091 plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1092 // But location is still at the last explicit update.
1093 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub3 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1094 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub3 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1095 plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub3 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1096 "Sub3 50%"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation
(), "Sub3 50%"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation
(), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")"
")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1097 } // End of plSub2
1098
1099 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1100 pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1101 plSub1.GetGlobalProgress(), 75_pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(
), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)"
")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1102 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1103 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1104 plSub1.GetLastGlobalLocation(), "Sub2 ended"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")"
")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1105 } // End of plSub1
1106
1107 MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr->Progress().IsExactlyOne())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(progressRefPtr->Progress().IsExactlyOne()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyOne()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1107); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyOne()"
")"); do { *((volatile int*)__null) = 1107; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1108 MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pl.GetGlobalProgress().IsExactlyOne())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(pl.GetGlobalProgress().IsExactlyOne()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyOne()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1108); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyOne()"
")"); do { *((volatile int*)__null) = 1108; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1109 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Sub1 ended"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Sub1 ended")))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")"
")"); do { *((volatile int*)__null) = 1110; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1110 pl.GetLastGlobalLocation(), "Sub1 ended"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "Sub1 ended"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "Sub1 ended")))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")"
")"); do { *((volatile int*)__null) = 1110; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1111
1112 const auto loopStart = 75_pc;
1113 const auto loopEnd = 87.5_pc;
1114 const uint32_t loopCount = 8;
1115 uint32_t expectedIndex = 0u;
1116 auto expectedIterationStart = loopStart;
1117 const auto iterationIncrement = (loopEnd - loopStart) / loopCount;
1118 for (auto&& [index, loopPL] : pl.CreateLoopSubLoggersFromTo(
1119 loopStart, loopEnd, loopCount, "looping...")) {
1120 MOZ_RELEASE_ASSERT(index == expectedIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index == expectedIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index == expectedIndex))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("index == expectedIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1120); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "index == expectedIndex"
")"); do { *((volatile int*)__null) = 1120; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1121 ++expectedIndex;
1122 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1123 AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1124 loopPL.GetGlobalProgress(), expectedIterationStart))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1125 MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1126 progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1127 loopPL.GetLastGlobalLocation(), "looping..."))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")"
")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1128
1129 loopPL.SetLocalProgress(50_pc, "half");
1130 MOZ_RELEASE_ASSERT(loopPL.GetGlobalProgress() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(loopPL.GetGlobalProgress() == expectedIterationStart
+ iterationIncrement / 2u)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(loopPL.GetGlobalProgress() ==
expectedIterationStart + iterationIncrement / 2u))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u"
")"); do { *((volatile int*)__null) = 1131; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1131 expectedIterationStart + iterationIncrement / 2u)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(loopPL.GetGlobalProgress() == expectedIterationStart
+ iterationIncrement / 2u)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(loopPL.GetGlobalProgress() ==
expectedIterationStart + iterationIncrement / 2u))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u"
")"); do { *((volatile int*)__null) = 1131; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1132 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1133 AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1134 loopPL.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1135 expectedIterationStart + iterationIncrement / 2u))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement
/ 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)"
")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1136 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation
(), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1137 pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation
(), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1138 loopPL.GetLastGlobalLocation(), "half"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation
(), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")"
")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1139
1140 expectedIterationStart = expectedIterationStart + iterationIncrement;
1141 }
1142 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), expectedIterationStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), expectedIterationStart)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1143 pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), expectedIterationStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), expectedIterationStart)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1144 expectedIterationStart))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress
(), expectedIterationStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
Progress(), pl.GetGlobalProgress(), expectedIterationStart)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)"
")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1145 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "looping..."))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "looping...")))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")"
")"); do { *((volatile int*)__null) = 1146; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1146 pl.GetLastGlobalLocation(), "looping..."))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation
(), "looping..."))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->
LastLocation(), pl.GetLastGlobalLocation(), "looping...")))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")"
")"); do { *((volatile int*)__null) = 1146; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1147 } // End of pl
1148 MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(progressRefPtr->Progress().IsExactlyOne())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(progressRefPtr->Progress().IsExactlyOne()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyOne()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1148); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyOne()"
")"); do { *((volatile int*)__null) = 1148; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1149 MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(), "All done"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(AreAllEqual(progressRefPtr->LastLocation(), "All done"
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(AreAllEqual(progressRefPtr->LastLocation(), "All done"
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("AreAllEqual(progressRefPtr->LastLocation(), \"All done\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1149); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), \"All done\")"
")"); do { *((volatile int*)__null) = 1149; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1150
1151 printf("TestProgressLogger done\n");
1152}
1153
1154#ifdef MOZ_GECKO_PROFILER1
1155
1156MOZ_MAYBE_UNUSED__attribute__((__unused__)) static void SleepMilli(unsigned aMilliseconds) {
1157# if defined(_MSC_VER) || defined(__MINGW32__)
1158 Sleep(aMilliseconds);
1159# else
1160 struct timespec ts = {/* .tv_sec */ static_cast<time_t>(aMilliseconds / 1000),
1161 /* ts.tv_nsec */ long(aMilliseconds % 1000) * 1000000};
1162 struct timespec tr = {0, 0};
1163 while (nanosleep(&ts, &tr)) {
1164 if (errno(*__errno_location ()) == EINTR4) {
1165 ts = tr;
1166 } else {
1167 printf("nanosleep() -> %s\n", strerror(errno(*__errno_location ())));
1168 exit(1);
1169 }
1170 }
1171# endif
1172}
1173
1174MOZ_MAYBE_UNUSED__attribute__((__unused__)) static void WaitUntilTimeStampChanges(
1175 const mozilla::TimeStamp& aTimeStampToCompare = mozilla::TimeStamp::Now()) {
1176 while (aTimeStampToCompare == mozilla::TimeStamp::Now()) {
1177 SleepMilli(1);
1178 }
1179}
1180
1181using namespace mozilla;
1182
1183void TestPowerOfTwoMask() {
1184 printf("TestPowerOfTwoMask...\n");
1185
1186 static_assert(MakePowerOfTwoMask<uint32_t, 0>().MaskValue() == 0);
1187 constexpr PowerOfTwoMask<uint32_t> c0 = MakePowerOfTwoMask<uint32_t, 0>();
1188 MOZ_RELEASE_ASSERT(c0.MaskValue() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(c0.MaskValue() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(c0.MaskValue() == 0))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("c0.MaskValue() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1188); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c0.MaskValue() == 0"
")"); do { *((volatile int*)__null) = 1188; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1189
1190 static_assert(MakePowerOfTwoMask<uint32_t, 0xFFu>().MaskValue() == 0xFFu);
1191 constexpr PowerOfTwoMask<uint32_t> cFF =
1192 MakePowerOfTwoMask<uint32_t, 0xFFu>();
1193 MOZ_RELEASE_ASSERT(cFF.MaskValue() == 0xFFu)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cFF.MaskValue() == 0xFFu)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cFF.MaskValue() == 0xFFu))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("cFF.MaskValue() == 0xFFu"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1193); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cFF.MaskValue() == 0xFFu"
")"); do { *((volatile int*)__null) = 1193; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1194
1195 static_assert(MakePowerOfTwoMask<uint32_t, 0xFFFFFFFFu>().MaskValue() ==
1196 0xFFFFFFFFu);
1197 constexpr PowerOfTwoMask<uint32_t> cFFFFFFFF =
1198 MakePowerOfTwoMask<uint32_t, 0xFFFFFFFFu>();
1199 MOZ_RELEASE_ASSERT(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cFFFFFFFF.MaskValue() == 0xFFFFFFFFu", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1199); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cFFFFFFFF.MaskValue() == 0xFFFFFFFFu"
")"); do { *((volatile int*)__null) = 1199; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1200
1201 struct TestDataU32 {
1202 uint32_t mInput;
1203 uint32_t mMask;
1204 };
1205 // clang-format off
1206 TestDataU32 tests[] = {
1207 { 0, 0 },
1208 { 1, 1 },
1209 { 2, 3 },
1210 { 3, 3 },
1211 { 4, 7 },
1212 { 5, 7 },
1213 { (1u << 31) - 1, (1u << 31) - 1 },
1214 { (1u << 31), uint32_t(-1) },
1215 { (1u << 31) + 1, uint32_t(-1) },
1216 { uint32_t(-1), uint32_t(-1) }
1217 };
1218 // clang-format on
1219 for (const TestDataU32& test : tests) {
1220 PowerOfTwoMask<uint32_t> p2m(test.mInput);
1221 MOZ_RELEASE_ASSERT(p2m.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p2m.MaskValue() == test.mMask)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p2m.MaskValue() == test.mMask
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"p2m.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2m.MaskValue() == test.mMask"
")"); do { *((volatile int*)__null) = 1221; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1222 for (const TestDataU32& inner : tests) {
1223 if (p2m.MaskValue() != uint32_t(-1)) {
1224 MOZ_RELEASE_ASSERT((inner.mInput % p2m) ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue
() + 1)))>::isValid, "invalid assertion condition"); if ((
__builtin_expect(!!(!(!!((inner.mInput % p2m) == (inner.mInput
% (p2m.MaskValue() + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))"
")"); do { *((volatile int*)__null) = 1225; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1225 (inner.mInput % (p2m.MaskValue() + 1)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue
() + 1)))>::isValid, "invalid assertion condition"); if ((
__builtin_expect(!!(!(!!((inner.mInput % p2m) == (inner.mInput
% (p2m.MaskValue() + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))"
")"); do { *((volatile int*)__null) = 1225; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1226 }
1227 MOZ_RELEASE_ASSERT((inner.mInput & p2m) == (inner.mInput % p2m))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((inner.mInput & p2m) == (inner.mInput % p2m))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((inner.mInput & p2m) == (inner.mInput % p2m)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("(inner.mInput & p2m) == (inner.mInput % p2m)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1227); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput & p2m) == (inner.mInput % p2m)"
")"); do { *((volatile int*)__null) = 1227; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1228 MOZ_RELEASE_ASSERT((p2m & inner.mInput) == (inner.mInput & p2m))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((p2m & inner.mInput) == (inner.mInput & p2m)
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((p2m & inner.mInput) == (inner.mInput & p2m)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"(p2m & inner.mInput) == (inner.mInput & p2m)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1228); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(p2m & inner.mInput) == (inner.mInput & p2m)"
")"); do { *((volatile int*)__null) = 1228; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1229 }
1230 }
1231
1232 printf("TestPowerOfTwoMask done\n");
1233}
1234
1235void TestPowerOfTwo() {
1236 printf("TestPowerOfTwo...\n");
1237
1238 static_assert(MakePowerOfTwo<uint32_t, 1>().Value() == 1);
1239 constexpr PowerOfTwo<uint32_t> c1 = MakePowerOfTwo<uint32_t, 1>();
1240 MOZ_RELEASE_ASSERT(c1.Value() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(c1.Value() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(c1.Value() == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("c1.Value() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c1.Value() == 1"
")"); do { *((volatile int*)__null) = 1240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1241 static_assert(MakePowerOfTwo<uint32_t, 1>().Mask().MaskValue() == 0);
1242
1243 static_assert(MakePowerOfTwo<uint32_t, 128>().Value() == 128);
1244 constexpr PowerOfTwo<uint32_t> c128 = MakePowerOfTwo<uint32_t, 128>();
1245 MOZ_RELEASE_ASSERT(c128.Value() == 128)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(c128.Value() == 128)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(c128.Value() == 128))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("c128.Value() == 128"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c128.Value() == 128"
")"); do { *((volatile int*)__null) = 1245; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1246 static_assert(MakePowerOfTwo<uint32_t, 128>().Mask().MaskValue() == 127);
1247
1248 static_assert(MakePowerOfTwo<uint32_t, 0x80000000u>().Value() == 0x80000000u);
1249 constexpr PowerOfTwo<uint32_t> cMax = MakePowerOfTwo<uint32_t, 0x80000000u>();
1250 MOZ_RELEASE_ASSERT(cMax.Value() == 0x80000000u)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cMax.Value() == 0x80000000u)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cMax.Value() == 0x80000000u)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cMax.Value() == 0x80000000u"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cMax.Value() == 0x80000000u"
")"); do { *((volatile int*)__null) = 1250; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1251 static_assert(MakePowerOfTwo<uint32_t, 0x80000000u>().Mask().MaskValue() ==
1252 0x7FFFFFFFu);
1253
1254 struct TestDataU32 {
1255 uint32_t mInput;
1256 uint32_t mValue;
1257 uint32_t mMask;
1258 };
1259 // clang-format off
1260 TestDataU32 tests[] = {
1261 { 0, 1, 0 },
1262 { 1, 1, 0 },
1263 { 2, 2, 1 },
1264 { 3, 4, 3 },
1265 { 4, 4, 3 },
1266 { 5, 8, 7 },
1267 { (1u << 31) - 1, (1u << 31), (1u << 31) - 1 },
1268 { (1u << 31), (1u << 31), (1u << 31) - 1 },
1269 { (1u << 31) + 1, (1u << 31), (1u << 31) - 1 },
1270 { uint32_t(-1), (1u << 31), (1u << 31) - 1 }
1271 };
1272 // clang-format on
1273 for (const TestDataU32& test : tests) {
1274 PowerOfTwo<uint32_t> p2(test.mInput);
1275 MOZ_RELEASE_ASSERT(p2.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p2.Value() == test.mValue)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p2.Value() == test.mValue)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("p2.Value() == test.mValue"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1275); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2.Value() == test.mValue"
")"); do { *((volatile int*)__null) = 1275; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1276 MOZ_RELEASE_ASSERT(p2.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p2.MaskValue() == test.mMask)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p2.MaskValue() == test.mMask
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"p2.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1276); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2.MaskValue() == test.mMask"
")"); do { *((volatile int*)__null) = 1276; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1277 PowerOfTwoMask<uint32_t> p2m = p2.Mask();
1278 MOZ_RELEASE_ASSERT(p2m.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p2m.MaskValue() == test.mMask)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p2m.MaskValue() == test.mMask
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"p2m.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1278); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2m.MaskValue() == test.mMask"
")"); do { *((volatile int*)__null) = 1278; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1279 for (const TestDataU32& inner : tests) {
1280 MOZ_RELEASE_ASSERT((inner.mInput % p2) == (inner.mInput % p2.Value()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((inner.mInput % p2) == (inner.mInput % p2.Value()))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((inner.mInput % p2) == (inner.mInput % p2.Value())))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("(inner.mInput % p2) == (inner.mInput % p2.Value())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1280); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2) == (inner.mInput % p2.Value())"
")"); do { *((volatile int*)__null) = 1280; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1281 }
1282 }
1283
1284 printf("TestPowerOfTwo done\n");
1285}
1286
1287void TestLEB128() {
1288 printf("TestLEB128...\n");
1289
1290 MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint8_t>() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128MaxSize<uint8_t>() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ULEB128MaxSize<uint8_t>
() == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("ULEB128MaxSize<uint8_t>() == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1290); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint8_t>() == 2"
")"); do { *((volatile int*)__null) = 1290; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1291 MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint16_t>() == 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128MaxSize<uint16_t>() == 3)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(ULEB128MaxSize<uint16_t>() == 3))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint16_t>() == 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1291); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint16_t>() == 3"
")"); do { *((volatile int*)__null) = 1291; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1292 MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint32_t>() == 5)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128MaxSize<uint32_t>() == 5)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(ULEB128MaxSize<uint32_t>() == 5))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint32_t>() == 5"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint32_t>() == 5"
")"); do { *((volatile int*)__null) = 1292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1293 MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint64_t>() == 10)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128MaxSize<uint64_t>() == 10)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(ULEB128MaxSize<uint64_t>() == 10))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint64_t>() == 10"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1293); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint64_t>() == 10"
")"); do { *((volatile int*)__null) = 1293; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1294
1295 struct TestDataU64 {
1296 uint64_t mValue;
1297 unsigned mSize;
1298 const char* mBytes;
1299 };
1300 // clang-format off
1301 TestDataU64 tests[] = {
1302 // Small numbers should keep their normal byte representation.
1303 { 0u, 1, "\0" },
1304 { 1u, 1, "\x01" },
1305
1306 // 0111 1111 (127, or 0x7F) is the highest number that fits into a single
1307 // LEB128 byte. It gets encoded as 0111 1111, note the most significant bit
1308 // is off.
1309 { 0x7Fu, 1, "\x7F" },
1310
1311 // Next number: 128, or 0x80.
1312 // Original data representation: 1000 0000
1313 // Broken up into groups of 7: 1 0000000
1314 // Padded with 0 (msB) or 1 (lsB): 00000001 10000000
1315 // Byte representation: 0x01 0x80
1316 // Little endian order: -> 0x80 0x01
1317 { 0x80u, 2, "\x80\x01" },
1318
1319 // Next: 129, or 0x81 (showing that we don't lose low bits.)
1320 // Original data representation: 1000 0001
1321 // Broken up into groups of 7: 1 0000001
1322 // Padded with 0 (msB) or 1 (lsB): 00000001 10000001
1323 // Byte representation: 0x01 0x81
1324 // Little endian order: -> 0x81 0x01
1325 { 0x81u, 2, "\x81\x01" },
1326
1327 // Highest 8-bit number: 255, or 0xFF.
1328 // Original data representation: 1111 1111
1329 // Broken up into groups of 7: 1 1111111
1330 // Padded with 0 (msB) or 1 (lsB): 00000001 11111111
1331 // Byte representation: 0x01 0xFF
1332 // Little endian order: -> 0xFF 0x01
1333 { 0xFFu, 2, "\xFF\x01" },
1334
1335 // Next: 256, or 0x100.
1336 // Original data representation: 1 0000 0000
1337 // Broken up into groups of 7: 10 0000000
1338 // Padded with 0 (msB) or 1 (lsB): 00000010 10000000
1339 // Byte representation: 0x10 0x80
1340 // Little endian order: -> 0x80 0x02
1341 { 0x100u, 2, "\x80\x02" },
1342
1343 // Highest 32-bit number: 0xFFFFFFFF (8 bytes, all bits set).
1344 // Original: 1111 1111 1111 1111 1111 1111 1111 1111
1345 // Groups: 1111 1111111 1111111 1111111 1111111
1346 // Padded: 00001111 11111111 11111111 11111111 11111111
1347 // Bytes: 0x0F 0xFF 0xFF 0xFF 0xFF
1348 // Little Endian: -> 0xFF 0xFF 0xFF 0xFF 0x0F
1349 { 0xFFFFFFFFu, 5, "\xFF\xFF\xFF\xFF\x0F" },
1350
1351 // Highest 64-bit number: 0xFFFFFFFFFFFFFFFF (16 bytes, all bits set).
1352 // 64 bits, that's 9 groups of 7 bits, plus 1 (most significant) bit.
1353 { 0xFFFFFFFFFFFFFFFFu, 10, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01" }
1354 };
1355 // clang-format on
1356
1357 for (const TestDataU64& test : tests) {
1358 MOZ_RELEASE_ASSERT(ULEB128Size(test.mValue) == test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(test.mValue) == test.mSize)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(ULEB128Size(test.mValue) == test.mSize))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("ULEB128Size(test.mValue) == test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1358); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(test.mValue) == test.mSize"
")"); do { *((volatile int*)__null) = 1358; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1359 // Prepare a buffer that can accomodate the largest-possible LEB128.
1360 uint8_t buffer[ULEB128MaxSize<uint64_t>()];
1361 // Use a pointer into the buffer as iterator.
1362 uint8_t* p = buffer;
1363 // And write the LEB128.
1364 WriteULEB128(test.mValue, p);
1365 // Pointer (iterator) should have advanced just past the expected LEB128
1366 // size.
1367 MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1367); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1367; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1368 // Check expected bytes.
1369 for (unsigned i = 0; i < test.mSize; ++i) {
1370 MOZ_RELEASE_ASSERT(buffer[i] == uint8_t(test.mBytes[i]))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(buffer[i] == uint8_t(test.mBytes[i]))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t(test.mBytes
[i])))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("buffer[i] == uint8_t(test.mBytes[i])", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1370); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t(test.mBytes[i])"
")"); do { *((volatile int*)__null) = 1370; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1371 }
1372
1373 // Move pointer (iterator) back to start of buffer.
1374 p = buffer;
1375 // And read the LEB128 we wrote above.
1376 uint64_t read = ReadULEB128<uint64_t>(p);
1377 // Pointer (iterator) should have also advanced just past the expected
1378 // LEB128 size.
1379 MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1379); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1379; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1380 // And check the read value.
1381 MOZ_RELEASE_ASSERT(read == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == test.mValue)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == test.mValue))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("read == test.mValue"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1381); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == test.mValue"
")"); do { *((volatile int*)__null) = 1381; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1382
1383 // Testing ULEB128 reader.
1384 ULEB128Reader<uint64_t> reader;
1385 MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1385); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1385; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1386 // Move pointer back to start of buffer.
1387 p = buffer;
1388 for (;;) {
1389 // Read a byte and feed it to the reader.
1390 if (reader.FeedByteIsComplete(*p++)) {
1391 break;
1392 }
1393 // Not complete yet, we shouldn't have reached the end pointer.
1394 MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1394; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1395 MOZ_RELEASE_ASSERT(p < buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p < buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p < buffer + test.mSize))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p < buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1395); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p < buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1395; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1396 }
1397 MOZ_RELEASE_ASSERT(reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reader.IsComplete()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1397); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1397; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1398 // Pointer should have advanced just past the expected LEB128 size.
1399 MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1399); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1399; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1400 // And check the read value.
1401 MOZ_RELEASE_ASSERT(reader.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reader.Value() == test.mValue)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reader.Value() == test.mValue
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"reader.Value() == test.mValue", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1401); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.Value() == test.mValue"
")"); do { *((volatile int*)__null) = 1401; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1402
1403 // And again after a Reset.
1404 reader.Reset();
1405 MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1405); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1405; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1406 p = buffer;
1407 for (;;) {
1408 if (reader.FeedByteIsComplete(*p++)) {
1409 break;
1410 }
1411 MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1411); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1411; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1412 MOZ_RELEASE_ASSERT(p < buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p < buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p < buffer + test.mSize))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p < buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1412); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p < buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1412; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1413 }
1414 MOZ_RELEASE_ASSERT(reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reader.IsComplete())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reader.IsComplete()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("reader.IsComplete()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.IsComplete()"
")"); do { *((volatile int*)__null) = 1414; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1415 MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1415); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize"
")"); do { *((volatile int*)__null) = 1415; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1416 MOZ_RELEASE_ASSERT(reader.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reader.Value() == test.mValue)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reader.Value() == test.mValue
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"reader.Value() == test.mValue", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1416); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.Value() == test.mValue"
")"); do { *((volatile int*)__null) = 1416; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1417 }
1418
1419 printf("TestLEB128 done\n");
1420}
1421
1422struct StringWriteFunc final : public JSONWriteFunc {
1423 std::string mString;
1424
1425 void Write(const mozilla::Span<const char>& aStr) final {
1426 mString.append(aStr.data(), aStr.size());
1427 }
1428};
1429
1430void CheckJSON(mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
1431 const char* aExpected, int aLine) {
1432 const std::string& actual =
1433 static_cast<StringWriteFunc&>(aWriter.WriteFunc()).mString;
1434 if (strcmp(aExpected, actual.c_str()) != 0) {
1435 fprintf(stderrstderr,
1436 "---- EXPECTED ---- (line %d)\n<<<%s>>>\n"
1437 "---- ACTUAL ----\n<<<%s>>>\n",
1438 aLine, aExpected, actual.c_str());
1439 MOZ_RELEASE_ASSERT(false, "expected and actual output don't match")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "expected and actual output don't match"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1439); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "expected and actual output don't match" ")"); do { *(
(volatile int*)__null) = 1439; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1440 }
1441}
1442
1443void TestJSONTimeOutput() {
1444 printf("TestJSONTimeOutput...\n");
1445
1446# define TEST(in, out) \
1447 do { \
1448 mozilla::baseprofiler::SpliceableJSONWriter writer( \
1449 mozilla::MakeUnique<StringWriteFunc>(), \
1450 FailureLatchInfallibleSource::Singleton()); \
1451 writer.Start(); \
1452 writer.TimeDoubleMsProperty("time_ms", (in)); \
1453 writer.End(); \
1454 CheckJSON(writer, "{\"time_ms\":" out "}", __LINE__1454); \
1455 } while (false);
1456
1457 TEST(0, "0");
1458
1459 TEST(0.000'000'1, "0");
1460 TEST(0.000'000'4, "0");
1461 TEST(0.000'000'499, "0");
1462 TEST(0.000'000'5, "0.000001");
1463 TEST(0.000'001, "0.000001");
1464 TEST(0.000'01, "0.00001");
1465 TEST(0.000'1, "0.0001");
1466 TEST(0.001, "0.001");
1467 TEST(0.01, "0.01");
1468 TEST(0.1, "0.1");
1469 TEST(1, "1");
1470 TEST(2, "2");
1471 TEST(10, "10");
1472 TEST(100, "100");
1473 TEST(1'000, "1000");
1474 TEST(10'000, "10000");
1475 TEST(100'000, "100000");
1476 TEST(1'000'000, "1000000");
1477 // 2^53-2 ns in ms. 2^53-1 is the highest integer value representable in
1478 // double, -1 again because we're adding 0.5 before truncating.
1479 // That's 104 days, after which the nanosecond precision would decrease.
1480 TEST(9'007'199'254.740'990, "9007199254.74099");
1481
1482 TEST(-0.000'000'1, "0");
1483 TEST(-0.000'000'4, "0");
1484 TEST(-0.000'000'499, "0");
1485 TEST(-0.000'000'5, "-0.000001");
1486 TEST(-0.000'001, "-0.000001");
1487 TEST(-0.000'01, "-0.00001");
1488 TEST(-0.000'1, "-0.0001");
1489 TEST(-0.001, "-0.001");
1490 TEST(-0.01, "-0.01");
1491 TEST(-0.1, "-0.1");
1492 TEST(-1, "-1");
1493 TEST(-2, "-2");
1494 TEST(-10, "-10");
1495 TEST(-100, "-100");
1496 TEST(-1'000, "-1000");
1497 TEST(-10'000, "-10000");
1498 TEST(-100'000, "-100000");
1499 TEST(-1'000'000, "-1000000");
1500 TEST(-9'007'199'254.740'990, "-9007199254.74099");
1501
1502# undef TEST
1503
1504 printf("TestJSONTimeOutput done\n");
1505}
1506
1507template <uint8_t byte, uint8_t... tail>
1508constexpr bool TestConstexprULEB128Reader(ULEB128Reader<uint64_t>& aReader) {
1509 if (aReader.IsComplete()) {
1510 return false;
1511 }
1512 const bool isComplete = aReader.FeedByteIsComplete(byte);
1513 if (aReader.IsComplete() != isComplete) {
1514 return false;
1515 }
1516 if constexpr (sizeof...(tail) == 0) {
1517 return isComplete;
1518 } else {
1519 if (isComplete) {
1520 return false;
1521 }
1522 return TestConstexprULEB128Reader<tail...>(aReader);
1523 }
1524}
1525
1526template <uint64_t expected, uint8_t... bytes>
1527constexpr bool TestConstexprULEB128Reader() {
1528 ULEB128Reader<uint64_t> reader;
1529 if (!TestConstexprULEB128Reader<bytes...>(reader)) {
1530 return false;
1531 }
1532 if (!reader.IsComplete()) {
1533 return false;
1534 }
1535 if (reader.Value() != expected) {
1536 return false;
1537 }
1538
1539 reader.Reset();
1540 if (!TestConstexprULEB128Reader<bytes...>(reader)) {
1541 return false;
1542 }
1543 if (!reader.IsComplete()) {
1544 return false;
1545 }
1546 if (reader.Value() != expected) {
1547 return false;
1548 }
1549
1550 return true;
1551}
1552
1553static_assert(TestConstexprULEB128Reader<0x0u, 0x0u>());
1554static_assert(!TestConstexprULEB128Reader<0x0u, 0x0u, 0x0u>());
1555static_assert(TestConstexprULEB128Reader<0x1u, 0x1u>());
1556static_assert(TestConstexprULEB128Reader<0x7Fu, 0x7Fu>());
1557static_assert(TestConstexprULEB128Reader<0x80u, 0x80u, 0x01u>());
1558static_assert(!TestConstexprULEB128Reader<0x80u, 0x80u>());
1559static_assert(!TestConstexprULEB128Reader<0x80u, 0x01u>());
1560static_assert(TestConstexprULEB128Reader<0x81u, 0x81u, 0x01u>());
1561static_assert(TestConstexprULEB128Reader<0xFFu, 0xFFu, 0x01u>());
1562static_assert(TestConstexprULEB128Reader<0x100u, 0x80u, 0x02u>());
1563static_assert(TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu,
1564 0xFFu, 0x0Fu>());
1565static_assert(
1566 !TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu>());
1567static_assert(!TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu,
1568 0xFFu, 0xFFu, 0x0Fu>());
1569static_assert(
1570 TestConstexprULEB128Reader<0xFFFFFFFFFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu,
1571 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0x01u>());
1572static_assert(
1573 !TestConstexprULEB128Reader<0xFFFFFFFFFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu,
1574 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu>());
1575
1576static void TestChunk() {
1577 printf("TestChunk...\n");
1578
1579 static_assert(!std::is_default_constructible_v<ProfileBufferChunk>,
1580 "ProfileBufferChunk should not be default-constructible");
1581 static_assert(
1582 !std::is_constructible_v<ProfileBufferChunk, ProfileBufferChunk::Length>,
1583 "ProfileBufferChunk should not be constructible from Length");
1584
1585 static_assert(
1586 sizeof(ProfileBufferChunk::Header) ==
1587 sizeof(ProfileBufferChunk::Header::mOffsetFirstBlock) +
1588 sizeof(ProfileBufferChunk::Header::mOffsetPastLastBlock) +
1589 sizeof(ProfileBufferChunk::Header::mStartTimeStamp) +
1590 sizeof(ProfileBufferChunk::Header::mDoneTimeStamp) +
1591 sizeof(ProfileBufferChunk::Header::mBufferBytes) +
1592 sizeof(ProfileBufferChunk::Header::mBlockCount) +
1593 sizeof(ProfileBufferChunk::Header::mRangeStart) +
1594 sizeof(ProfileBufferChunk::Header::mProcessId) +
1595 sizeof(ProfileBufferChunk::Header::mPADDING),
1596 "ProfileBufferChunk::Header may have unwanted padding, please review");
1597 // Note: The above static_assert is an attempt at keeping
1598 // ProfileBufferChunk::Header tightly packed, but some changes could make this
1599 // impossible to achieve (most probably due to alignment) -- Just do your
1600 // best!
1601
1602 constexpr ProfileBufferChunk::Length TestLen = 1000;
1603
1604 // Basic allocations of different sizes.
1605 for (ProfileBufferChunk::Length len = 0; len <= TestLen; ++len) {
1606 auto chunk = ProfileBufferChunk::Create(len);
1607 static_assert(
1608 std::is_same_v<decltype(chunk), UniquePtr<ProfileBufferChunk>>,
1609 "ProfileBufferChunk::Create() should return a "
1610 "UniquePtr<ProfileBufferChunk>");
1611 MOZ_RELEASE_ASSERT(!!chunk, "OOM!?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "OOM!?" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1611); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "OOM!?" ")"); do { *((volatile int*)__null) = 1611; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
;
1612 MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= len)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= len)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->BufferBytes() >=
len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->BufferBytes() >= len", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= len"
")"); do { *((volatile int*)__null) = 1612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1613 MOZ_RELEASE_ASSERT(chunk->ChunkBytes() >=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkBytes() >= len + ProfileBufferChunk
::SizeofChunkMetadata())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->ChunkBytes() >=
len + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1614); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()"
")"); do { *((volatile int*)__null) = 1614; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1614 len + ProfileBufferChunk::SizeofChunkMetadata())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkBytes() >= len + ProfileBufferChunk
::SizeofChunkMetadata())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->ChunkBytes() >=
len + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1614); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()"
")"); do { *((volatile int*)__null) = 1614; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1615 MOZ_RELEASE_ASSERT(chunk->RemainingBytes() == chunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RemainingBytes() == chunk->BufferBytes(
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->RemainingBytes() == chunk->BufferBytes(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->RemainingBytes() == chunk->BufferBytes()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RemainingBytes() == chunk->BufferBytes()"
")"); do { *((volatile int*)__null) = 1615; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1616 MOZ_RELEASE_ASSERT(chunk->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->OffsetFirstBlock()
== 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->OffsetFirstBlock() == 0"
")"); do { *((volatile int*)__null) = 1616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1617 MOZ_RELEASE_ASSERT(chunk->OffsetPastLastBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->OffsetPastLastBlock() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->OffsetPastLastBlock
() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->OffsetPastLastBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1617); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->OffsetPastLastBlock() == 0"
")"); do { *((volatile int*)__null) = 1617; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1618 MOZ_RELEASE_ASSERT(chunk->BlockCount() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BlockCount() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->BlockCount() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BlockCount() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1618); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BlockCount() == 0"
")"); do { *((volatile int*)__null) = 1618; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1619 MOZ_RELEASE_ASSERT(chunk->ProcessId() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ProcessId() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->ProcessId() == 0))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ProcessId() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ProcessId() == 0"
")"); do { *((volatile int*)__null) = 1619; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1620 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
")"); do { *((volatile int*)__null) = 1620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1621 MOZ_RELEASE_ASSERT(chunk->BufferSpan().LengthBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1622); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()"
")"); do { *((volatile int*)__null) = 1622; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1622 chunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1622); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()"
")"); do { *((volatile int*)__null) = 1622; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1623 MOZ_RELEASE_ASSERT(!chunk->GetNext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1623); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()"
")"); do { *((volatile int*)__null) = 1623; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1624 MOZ_RELEASE_ASSERT(!chunk->ReleaseNext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->ReleaseNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunk->ReleaseNext()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->ReleaseNext()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1624); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->ReleaseNext()"
")"); do { *((volatile int*)__null) = 1624; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1625 MOZ_RELEASE_ASSERT(chunk->Last() == chunk.get())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->Last() == chunk.get())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->Last() == chunk.get
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->Last() == chunk.get()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1625); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->Last() == chunk.get()"
")"); do { *((volatile int*)__null) = 1625; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1626 }
1627
1628 // Allocate the main test Chunk.
1629 auto chunkA = ProfileBufferChunk::Create(TestLen);
1630 MOZ_RELEASE_ASSERT(!!chunkA, "OOM!?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunkA)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunkA))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunkA" " (" "OOM!?" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1630); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunkA"
") (" "OOM!?" ")"); do { *((volatile int*)__null) = 1630; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
;
1631 MOZ_RELEASE_ASSERT(chunkA->BufferBytes() >= TestLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->BufferBytes() >= TestLen)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunkA->BufferBytes() >= TestLen))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("chunkA->BufferBytes() >= TestLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->BufferBytes() >= TestLen"
")"); do { *((volatile int*)__null) = 1631; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1632 MOZ_RELEASE_ASSERT(chunkA->ChunkBytes() >=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk
::SizeofChunkMetadata())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->ChunkBytes() >=
TestLen + ProfileBufferChunk::SizeofChunkMetadata()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1633); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()"
")"); do { *((volatile int*)__null) = 1633; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1633 TestLen + ProfileBufferChunk::SizeofChunkMetadata())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk
::SizeofChunkMetadata())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->ChunkBytes() >=
TestLen + ProfileBufferChunk::SizeofChunkMetadata()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1633); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()"
")"); do { *((volatile int*)__null) = 1633; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1634 MOZ_RELEASE_ASSERT(!chunkA->GetNext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunkA->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunkA->GetNext()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!chunkA->GetNext()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1634); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunkA->GetNext()"
")"); do { *((volatile int*)__null) = 1634; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1635 MOZ_RELEASE_ASSERT(!chunkA->ReleaseNext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunkA->ReleaseNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunkA->ReleaseNext())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunkA->ReleaseNext()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1635); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunkA->ReleaseNext()"
")"); do { *((volatile int*)__null) = 1635; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1636
1637 constexpr ProfileBufferIndex chunkARangeStart = 12345;
1638 chunkA->SetRangeStart(chunkARangeStart);
1639 MOZ_RELEASE_ASSERT(chunkA->RangeStart() == chunkARangeStart)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->RangeStart() == chunkARangeStart)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunkA->RangeStart() == chunkARangeStart))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("chunkA->RangeStart() == chunkARangeStart"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1639); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RangeStart() == chunkARangeStart"
")"); do { *((volatile int*)__null) = 1639; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1640
1641 // Get a read-only span over its buffer.
1642 auto bufferA = chunkA->BufferSpan();
1643 static_assert(
1644 std::is_same_v<decltype(bufferA), Span<const ProfileBufferChunk::Byte>>,
1645 "BufferSpan() should return a Span<const Byte>");
1646 MOZ_RELEASE_ASSERT(bufferA.LengthBytes() == chunkA->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bufferA.LengthBytes() == chunkA->BufferBytes())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(bufferA.LengthBytes() == chunkA->BufferBytes())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("bufferA.LengthBytes() == chunkA->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1646); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bufferA.LengthBytes() == chunkA->BufferBytes()"
")"); do { *((volatile int*)__null) = 1646; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1647
1648 // Add the initial tail block.
1649 constexpr ProfileBufferChunk::Length initTailLen = 10;
1650 auto initTail = chunkA->ReserveInitialBlockAsTail(initTailLen);
1651 static_assert(
1652 std::is_same_v<decltype(initTail), Span<ProfileBufferChunk::Byte>>,
1653 "ReserveInitialBlockAsTail() should return a Span<Byte>");
1654 MOZ_RELEASE_ASSERT(initTail.LengthBytes() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(initTail.LengthBytes() == initTailLen)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(initTail.LengthBytes() == initTailLen))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("initTail.LengthBytes() == initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail.LengthBytes() == initTailLen"
")"); do { *((volatile int*)__null) = 1654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1655 MOZ_RELEASE_ASSERT(initTail.Elements() == bufferA.Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(initTail.Elements() == bufferA.Elements())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(initTail.Elements() == bufferA.Elements()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("initTail.Elements() == bufferA.Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail.Elements() == bufferA.Elements()"
")"); do { *((volatile int*)__null) = 1655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1656 MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1656); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen"
")"); do { *((volatile int*)__null) = 1656; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1657 MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetPastLastBlock() == initTailLen)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkA->OffsetPastLastBlock() == initTailLen))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetPastLastBlock() == initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1657); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == initTailLen"
")"); do { *((volatile int*)__null) = 1657; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1658
1659 // Add the first complete block.
1660 constexpr ProfileBufferChunk::Length block1Len = 20;
1661 auto block1 = chunkA->ReserveBlock(block1Len);
1662 static_assert(
1663 std::is_same_v<decltype(block1), ProfileBufferChunk::ReserveReturn>,
1664 "ReserveBlock() should return a ReserveReturn");
1665 MOZ_RELEASE_ASSERT(block1.mBlockRangeIndex.ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block1.mBlockRangeIndex.ConvertToProfileBufferIndex(
) == chunkARangeStart + initTailLen)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(block1.mBlockRangeIndex.ConvertToProfileBufferIndex
() == chunkARangeStart + initTailLen))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen"
")"); do { *((volatile int*)__null) = 1666; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1666 chunkARangeStart + initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block1.mBlockRangeIndex.ConvertToProfileBufferIndex(
) == chunkARangeStart + initTailLen)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(block1.mBlockRangeIndex.ConvertToProfileBufferIndex
() == chunkARangeStart + initTailLen))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen"
")"); do { *((volatile int*)__null) = 1666; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1667 MOZ_RELEASE_ASSERT(block1.mSpan.LengthBytes() == block1Len)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block1.mSpan.LengthBytes() == block1Len)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(block1.mSpan.LengthBytes() == block1Len))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("block1.mSpan.LengthBytes() == block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.LengthBytes() == block1Len"
")"); do { *((volatile int*)__null) = 1667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1668 MOZ_RELEASE_ASSERT(block1.mSpan.Elements() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block1.mSpan.Elements() == bufferA.Elements() + initTailLen
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(block1.mSpan.Elements() == bufferA.Elements() + initTailLen
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"block1.mSpan.Elements() == bufferA.Elements() + initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1669); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.Elements() == bufferA.Elements() + initTailLen"
")"); do { *((volatile int*)__null) = 1669; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1669 bufferA.Elements() + initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block1.mSpan.Elements() == bufferA.Elements() + initTailLen
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(block1.mSpan.Elements() == bufferA.Elements() + initTailLen
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"block1.mSpan.Elements() == bufferA.Elements() + initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1669); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.Elements() == bufferA.Elements() + initTailLen"
")"); do { *((volatile int*)__null) = 1669; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1670 MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1670); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen"
")"); do { *((volatile int*)__null) = 1670; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1671 MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetPastLastBlock() == initTailLen + block1Len
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkA->OffsetPastLastBlock() == initTailLen + block1Len
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunkA->OffsetPastLastBlock() == initTailLen + block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1671); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == initTailLen + block1Len"
")"); do { *((volatile int*)__null) = 1671; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1672 MOZ_RELEASE_ASSERT(chunkA->RemainingBytes() != 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->RemainingBytes() != 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->RemainingBytes() !=
0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunkA->RemainingBytes() != 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RemainingBytes() != 0"
")"); do { *((volatile int*)__null) = 1672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1673
1674 // Add another block to over-fill the ProfileBufferChunk.
1675 const ProfileBufferChunk::Length remaining =
1676 chunkA->BufferBytes() - (initTailLen + block1Len);
1677 constexpr ProfileBufferChunk::Length overfill = 30;
1678 const ProfileBufferChunk::Length block2Len = remaining + overfill;
1679 ProfileBufferChunk::ReserveReturn block2 = chunkA->ReserveBlock(block2Len);
1680 MOZ_RELEASE_ASSERT(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block2.mBlockRangeIndex.ConvertToProfileBufferIndex(
) == chunkARangeStart + initTailLen + block1Len)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart
+ initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len"
")"); do { *((volatile int*)__null) = 1681; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1681 chunkARangeStart + initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block2.mBlockRangeIndex.ConvertToProfileBufferIndex(
) == chunkARangeStart + initTailLen + block1Len)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart
+ initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len"
")"); do { *((volatile int*)__null) = 1681; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1682 MOZ_RELEASE_ASSERT(block2.mSpan.LengthBytes() == remaining)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block2.mSpan.LengthBytes() == remaining)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(block2.mSpan.LengthBytes() == remaining))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("block2.mSpan.LengthBytes() == remaining"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.LengthBytes() == remaining"
")"); do { *((volatile int*)__null) = 1682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1683 MOZ_RELEASE_ASSERT(block2.mSpan.Elements() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block2.mSpan.Elements() == bufferA.Elements() + initTailLen
+ block1Len)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(block2.mSpan.Elements() == bufferA
.Elements() + initTailLen + block1Len))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len"
")"); do { *((volatile int*)__null) = 1684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1684 bufferA.Elements() + initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(block2.mSpan.Elements() == bufferA.Elements() + initTailLen
+ block1Len)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(block2.mSpan.Elements() == bufferA
.Elements() + initTailLen + block1Len))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len"
")"); do { *((volatile int*)__null) = 1684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1685 MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen"
")"); do { *((volatile int*)__null) = 1685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1686 MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunkA->OffsetPastLastBlock() == chunkA->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1686); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == chunkA->BufferBytes()"
")"); do { *((volatile int*)__null) = 1686; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1687 MOZ_RELEASE_ASSERT(chunkA->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->RemainingBytes() ==
0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunkA->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1687); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 1687; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1688
1689 // Block must be marked "done" before it can be recycled.
1690 chunkA->MarkDone();
1691
1692 // It must be marked "recycled" before data can be added to it again.
1693 chunkA->MarkRecycled();
1694
1695 // Add an empty initial tail block.
1696 Span<ProfileBufferChunk::Byte> initTail2 =
1697 chunkA->ReserveInitialBlockAsTail(0);
1698 MOZ_RELEASE_ASSERT(initTail2.LengthBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(initTail2.LengthBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(initTail2.LengthBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"initTail2.LengthBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1698); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail2.LengthBytes() == 0"
")"); do { *((volatile int*)__null) = 1698; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1699 MOZ_RELEASE_ASSERT(initTail2.Elements() == bufferA.Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(initTail2.Elements() == bufferA.Elements())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(initTail2.Elements() == bufferA.Elements()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("initTail2.Elements() == bufferA.Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail2.Elements() == bufferA.Elements()"
")"); do { *((volatile int*)__null) = 1699; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1700 MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->OffsetFirstBlock(
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunkA->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == 0"
")"); do { *((volatile int*)__null) = 1700; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1701 MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->OffsetPastLastBlock() == 0)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(chunkA->OffsetPastLastBlock() == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("chunkA->OffsetPastLastBlock() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == 0"
")"); do { *((volatile int*)__null) = 1701; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1702
1703 // Block must be marked "done" before it can be destroyed.
1704 chunkA->MarkDone();
1705
1706 chunkA->SetProcessId(123);
1707 MOZ_RELEASE_ASSERT(chunkA->ProcessId() == 123)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkA->ProcessId() == 123)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkA->ProcessId() == 123
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunkA->ProcessId() == 123", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ProcessId() == 123"
")"); do { *((volatile int*)__null) = 1707; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1708
1709 printf("TestChunk done\n");
1710}
1711
1712static void TestChunkManagerSingle() {
1713 printf("TestChunkManagerSingle...\n");
1714
1715 // Construct a ProfileBufferChunkManagerSingle for one chunk of size >=1000.
1716 constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 1000;
1717 ProfileBufferChunkManagerSingle cms{ChunkMinBufferBytes};
1718
1719 // Reference to base class, to exercize virtual methods.
1720 ProfileBufferChunkManager& cm = cms;
1721
1722# ifdef DEBUG1
1723 const char* chunkManagerRegisterer = "TestChunkManagerSingle";
1724 cm.RegisteredWith(chunkManagerRegisterer);
1725# endif // DEBUG
1726
1727 const auto maxTotalSize = cm.MaxTotalSize();
1728 MOZ_RELEASE_ASSERT(maxTotalSize >= ChunkMinBufferBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(maxTotalSize >= ChunkMinBufferBytes)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(maxTotalSize >= ChunkMinBufferBytes))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("maxTotalSize >= ChunkMinBufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1728); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "maxTotalSize >= ChunkMinBufferBytes"
")"); do { *((volatile int*)__null) = 1728; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1729
1730 cm.SetChunkDestroyedCallback([](const ProfileBufferChunk&) {
1731 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1732 false,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1733 "ProfileBufferChunkManagerSingle should never destroy its one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk"
")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1734 });
1735
1736 UniquePtr<ProfileBufferChunk> extantReleasedChunks =
1737 cm.GetExtantReleasedChunks();
1738 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1738); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1738; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1739
1740 // First request.
1741 UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk();
1742 MOZ_RELEASE_ASSERT(!!chunk, "First chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk request should always work" ")"); do { *(
(volatile int*)__null) = 1742; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1743 MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1744); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1744; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
1744 "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1744); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1744; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
1745 MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()"
" (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()"
") (" "There should only be one chunk" ")"); do { *((volatile
int*)__null) = 1745; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1746
1747 // Keep address, for later checks.
1748 const uintptr_t chunkAddress = reinterpret_cast<uintptr_t>(chunk.get());
1749
1750 extantReleasedChunks = cm.GetExtantReleasedChunks();
1751 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1751); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1751; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1752
1753 // Second request.
1754 MOZ_RELEASE_ASSERT(!cm.GetChunk(), "Second chunk request should always fail")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetChunk())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()"
" (" "Second chunk request should always fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1754); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()"
") (" "Second chunk request should always fail" ")"); do { *
((volatile int*)__null) = 1754; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1755
1756 extantReleasedChunks = cm.GetExtantReleasedChunks();
1757 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1757; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1758
1759 // Add some data to the chunk (to verify recycling later on).
1760 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1760); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0"
")"); do { *((volatile int*)__null) = 1760; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1761 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1761); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0"
")"); do { *((volatile int*)__null) = 1761; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1762 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1762); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
")"); do { *((volatile int*)__null) = 1762; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1763 chunk->SetRangeStart(100);
1764 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 100)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 100)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 100
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->RangeStart() == 100", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1764); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 100"
")"); do { *((volatile int*)__null) = 1764; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1765 Unused << chunk->ReserveInitialBlockAsTail(1);
1766 Unused << chunk->ReserveBlock(2);
1767 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 1)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1767); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 1"
")"); do { *((volatile int*)__null) = 1767; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1768 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1768); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2"
")"); do { *((volatile int*)__null) = 1768; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1769
1770 // Release the first chunk.
1771 chunk->MarkDone();
1772 cm.ReleaseChunk(std::move(chunk));
1773 MOZ_RELEASE_ASSERT(!chunk, "chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!chunk" " (" "chunk UniquePtr should have been moved-from"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1773); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk"
") (" "chunk UniquePtr should have been moved-from" ")"); do
{ *((volatile int*)__null) = 1773; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1774
1775 // Request after release.
1776 MOZ_RELEASE_ASSERT(!cm.GetChunk(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetChunk())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()"
" (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()"
") (" "Chunk request after release should also fail" ")"); do
{ *((volatile int*)__null) = 1777; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1777 "Chunk request after release should also fail")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetChunk())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()"
" (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()"
") (" "Chunk request after release should also fail" ")"); do
{ *((volatile int*)__null) = 1777; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1778
1779 // Check released chunk.
1780 extantReleasedChunks = cm.GetExtantReleasedChunks();
1781 MOZ_RELEASE_ASSERT(!!extantReleasedChunks,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!extantReleasedChunks))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!!extantReleasedChunks"
" (" "Could not retrieve released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!extantReleasedChunks"
") (" "Could not retrieve released chunk" ")"); do { *((volatile
int*)__null) = 1782; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
1782 "Could not retrieve released chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!extantReleasedChunks))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!!extantReleasedChunks"
" (" "Could not retrieve released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!extantReleasedChunks"
") (" "Could not retrieve released chunk" ")"); do { *((volatile
int*)__null) = 1782; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1783 MOZ_RELEASE_ASSERT(!extantReleasedChunks->GetNext(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks->GetNext
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!extantReleasedChunks->GetNext()" " (" "There should only be one released chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks->GetNext()"
") (" "There should only be one released chunk" ")"); do { *
((volatile int*)__null) = 1784; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
1784 "There should only be one released chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks->GetNext
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!extantReleasedChunks->GetNext()" " (" "There should only be one released chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks->GetNext()"
") (" "There should only be one released chunk" ")"); do { *
((volatile int*)__null) = 1784; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1785 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks
.get()) == chunkAddress)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t
>(extantReleasedChunks.get()) == chunkAddress))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
" (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
") (" "Released chunk should be first requested one" ")"); do
{ *((volatile int*)__null) = 1787; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1786 reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks
.get()) == chunkAddress)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t
>(extantReleasedChunks.get()) == chunkAddress))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
" (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
") (" "Released chunk should be first requested one" ")"); do
{ *((volatile int*)__null) = 1787; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1787 "Released chunk should be first requested one")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks
.get()) == chunkAddress)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t
>(extantReleasedChunks.get()) == chunkAddress))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
" (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress"
") (" "Released chunk should be first requested one" ")"); do
{ *((volatile int*)__null) = 1787; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1788
1789 MOZ_RELEASE_ASSERT(!cm.GetExtantReleasedChunks(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetExtantReleasedChunks())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetExtantReleasedChunks(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cm.GetExtantReleasedChunks()" " (" "Unexpected extra released chunk(s)"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetExtantReleasedChunks()"
") (" "Unexpected extra released chunk(s)" ")"); do { *((volatile
int*)__null) = 1790; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
1790 "Unexpected extra released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetExtantReleasedChunks())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetExtantReleasedChunks(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cm.GetExtantReleasedChunks()" " (" "Unexpected extra released chunk(s)"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetExtantReleasedChunks()"
") (" "Unexpected extra released chunk(s)" ")"); do { *((volatile
int*)__null) = 1790; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1791
1792 // Another request after release.
1793 MOZ_RELEASE_ASSERT(!cm.GetChunk(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetChunk())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()"
" (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()"
") (" "Chunk request after release should also fail" ")"); do
{ *((volatile int*)__null) = 1794; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1794 "Chunk request after release should also fail")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cm.GetChunk())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()"
" (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()"
") (" "Chunk request after release should also fail" ")"); do
{ *((volatile int*)__null) = 1794; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1795
1796 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change after requests&releases"
")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1797 cm.MaxTotalSize() == maxTotalSize,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change after requests&releases"
")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1798 "MaxTotalSize() should not change after requests&releases")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change after requests&releases"
")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1799
1800 // Reset the chunk manager. (Single-only non-virtual function.)
1801 cms.Reset(std::move(extantReleasedChunks));
1802 MOZ_RELEASE_ASSERT(!extantReleasedChunks,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Released chunk UniquePtr should have been moved-from" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1803); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Released chunk UniquePtr should have been moved-from"
")"); do { *((volatile int*)__null) = 1803; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1803 "Released chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Released chunk UniquePtr should have been moved-from" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1803); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Released chunk UniquePtr should have been moved-from"
")"); do { *((volatile int*)__null) = 1803; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1804
1805 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change when resetting with the same chunk"
")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1806 cm.MaxTotalSize() == maxTotalSize,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change when resetting with the same chunk"
")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1807 "MaxTotalSize() should not change when resetting with the same chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize"
") (" "MaxTotalSize() should not change when resetting with the same chunk"
")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1808
1809 // 2nd round, first request. Theoretically async, but this implementation just
1810 // immediately runs the callback.
1811 bool ran = false;
1812 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
1813 ran = true;
1814 MOZ_RELEASE_ASSERT(!!aChunk)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!aChunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1814); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk"
")"); do { *((volatile int*)__null) = 1814; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1815 chunk = std::move(aChunk);
1816 });
1817 MOZ_RELEASE_ASSERT(ran, "RequestChunk callback not called immediately")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "RequestChunk callback not called immediately"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1817); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "RequestChunk callback not called immediately" ")"); do
{ *((volatile int*)__null) = 1817; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1818 ran = false;
1819 cm.FulfillChunkRequests();
1820 MOZ_RELEASE_ASSERT(!ran, "FulfillChunkRequests should not have any effects")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!ran" " (" "FulfillChunkRequests should not have any effects"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1820); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran"
") (" "FulfillChunkRequests should not have any effects" ")"
); do { *((volatile int*)__null) = 1820; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1821 MOZ_RELEASE_ASSERT(!!chunk, "First chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1821); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk request should always work" ")"); do { *(
(volatile int*)__null) = 1821; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1822 MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1823; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
1823 "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1823; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
1824 MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()"
" (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1824); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()"
") (" "There should only be one chunk" ")"); do { *((volatile
int*)__null) = 1824; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1825 MOZ_RELEASE_ASSERT(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress"
" (" "Requested chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress"
") (" "Requested chunk should be first requested one" ")"); do
{ *((volatile int*)__null) = 1826; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1826 "Requested chunk should be first requested one")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress"
" (" "Requested chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress"
") (" "Requested chunk should be first requested one" ")"); do
{ *((volatile int*)__null) = 1826; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1827 // Verify that chunk is empty and usable.
1828 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0"
")"); do { *((volatile int*)__null) = 1828; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1829 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1829); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0"
")"); do { *((volatile int*)__null) = 1829; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1830 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1830); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
")"); do { *((volatile int*)__null) = 1830; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1831 chunk->SetRangeStart(200);
1832 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 200)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 200)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 200
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->RangeStart() == 200", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1832); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 200"
")"); do { *((volatile int*)__null) = 1832; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1833 Unused << chunk->ReserveInitialBlockAsTail(3);
1834 Unused << chunk->ReserveBlock(4);
1835 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 3)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 3))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 3"
")"); do { *((volatile int*)__null) = 1835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1836 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1836); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4"
")"); do { *((volatile int*)__null) = 1836; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1837
1838 // Second request.
1839 ran = false;
1840 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
1841 ran = true;
1842 MOZ_RELEASE_ASSERT(!aChunk, "Second chunk request should always fail")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aChunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!aChunk" " (" "Second chunk request should always fail"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1842); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!aChunk"
") (" "Second chunk request should always fail" ")"); do { *
((volatile int*)__null) = 1842; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1843 });
1844 MOZ_RELEASE_ASSERT(ran, "RequestChunk callback not called")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "RequestChunk callback not called"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1844); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "RequestChunk callback not called" ")"); do { *((volatile
int*)__null) = 1844; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1845
1846 // This one does nothing.
1847 cm.ForgetUnreleasedChunks();
1848
1849 // Don't forget to mark chunk "Done" before letting it die.
1850 chunk->MarkDone();
1851 chunk = nullptr;
1852
1853 // Create a tiny chunk and reset the chunk manager with it.
1854 chunk = ProfileBufferChunk::Create(1);
1855 MOZ_RELEASE_ASSERT(!!chunk)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1855); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
")"); do { *((volatile int*)__null) = 1855; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1856 auto tinyChunkSize = chunk->BufferBytes();
1857 MOZ_RELEASE_ASSERT(tinyChunkSize >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tinyChunkSize >= 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tinyChunkSize >= 1))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("tinyChunkSize >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1857); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tinyChunkSize >= 1"
")"); do { *((volatile int*)__null) = 1857; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1858 MOZ_RELEASE_ASSERT(tinyChunkSize < ChunkMinBufferBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tinyChunkSize < ChunkMinBufferBytes)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(tinyChunkSize < ChunkMinBufferBytes))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("tinyChunkSize < ChunkMinBufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1858); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tinyChunkSize < ChunkMinBufferBytes"
")"); do { *((volatile int*)__null) = 1858; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1859 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
")"); do { *((volatile int*)__null) = 1859; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1860 chunk->SetRangeStart(300);
1861 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 300)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 300)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 300
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->RangeStart() == 300", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1861); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 300"
")"); do { *((volatile int*)__null) = 1861; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1862 cms.Reset(std::move(chunk));
1863 MOZ_RELEASE_ASSERT(!chunk, "chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!chunk" " (" "chunk UniquePtr should have been moved-from"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1863); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk"
") (" "chunk UniquePtr should have been moved-from" ")"); do
{ *((volatile int*)__null) = 1863; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1864 MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == tinyChunkSize,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == tinyChunkSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == tinyChunkSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == tinyChunkSize" " (" "MaxTotalSize() should match the new chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1865); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == tinyChunkSize"
") (" "MaxTotalSize() should match the new chunk size" ")");
do { *((volatile int*)__null) = 1865; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1865 "MaxTotalSize() should match the new chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == tinyChunkSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == tinyChunkSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == tinyChunkSize" " (" "MaxTotalSize() should match the new chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1865); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == tinyChunkSize"
") (" "MaxTotalSize() should match the new chunk size" ")");
do { *((volatile int*)__null) = 1865; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1866 chunk = cm.GetChunk();
1867 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0, "Got non-recycled chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
" (" "Got non-recycled chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1867); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
") (" "Got non-recycled chunk" ")"); do { *((volatile int*)__null
) = 1867; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
1868
1869 // Enough testing! Clean-up.
1870 Unused << chunk->ReserveInitialBlockAsTail(0);
1871 chunk->MarkDone();
1872 cm.ForgetUnreleasedChunks();
1873
1874# ifdef DEBUG1
1875 cm.DeregisteredFrom(chunkManagerRegisterer);
1876# endif // DEBUG
1877
1878 printf("TestChunkManagerSingle done\n");
1879}
1880
1881static void TestChunkManagerWithLocalLimit() {
1882 printf("TestChunkManagerWithLocalLimit...\n");
1883
1884 // Construct a ProfileBufferChunkManagerWithLocalLimit with chunk of minimum
1885 // size >=100, up to 1000 bytes.
1886 constexpr ProfileBufferChunk::Length MaxTotalBytes = 1000;
1887 constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 100;
1888 ProfileBufferChunkManagerWithLocalLimit cmll{MaxTotalBytes,
1889 ChunkMinBufferBytes};
1890
1891 // Reference to base class, to exercize virtual methods.
1892 ProfileBufferChunkManager& cm = cmll;
1893
1894# ifdef DEBUG1
1895 const char* chunkManagerRegisterer = "TestChunkManagerWithLocalLimit";
1896 cm.RegisteredWith(chunkManagerRegisterer);
1897# endif // DEBUG
1898
1899 MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == MaxTotalBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes"
") (" "Max total size should be exactly as given" ")"); do {
*((volatile int*)__null) = 1900; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
1900 "Max total size should be exactly as given")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes"
") (" "Max total size should be exactly as given" ")"); do {
*((volatile int*)__null) = 1900; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
1901
1902 unsigned destroyedChunks = 0;
1903 unsigned destroyedBytes = 0;
1904 cm.SetChunkDestroyedCallback([&](const ProfileBufferChunk& aChunks) {
1905 for (const ProfileBufferChunk* chunk = &aChunks; chunk;
1906 chunk = chunk->GetNext()) {
1907 destroyedChunks += 1;
1908 destroyedBytes += chunk->BufferBytes();
1909 }
1910 });
1911
1912 UniquePtr<ProfileBufferChunk> extantReleasedChunks =
1913 cm.GetExtantReleasedChunks();
1914 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1914); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1914; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1915
1916 // First request.
1917 UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk();
1918 MOZ_RELEASE_ASSERT(!!chunk,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk immediate request should always work" ")"
); do { *((volatile int*)__null) = 1919; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1919 "First chunk immediate request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk immediate request should always work" ")"
); do { *((volatile int*)__null) = 1919; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1920 const auto chunkActualBufferBytes = chunk->BufferBytes();
1921 MOZ_RELEASE_ASSERT(chunkActualBufferBytes >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkActualBufferBytes >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkActualBufferBytes >= ChunkMinBufferBytes))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1922); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1922; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
1922 "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkActualBufferBytes >= ChunkMinBufferBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkActualBufferBytes >= ChunkMinBufferBytes))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes >= ChunkMinBufferBytes"
" (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1922); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes >= ChunkMinBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1922; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
1923 MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()"
" (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()"
") (" "There should only be one chunk" ")"); do { *((volatile
int*)__null) = 1923; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1924
1925 // Keep address, for later checks.
1926 const uintptr_t chunk1Address = reinterpret_cast<uintptr_t>(chunk.get());
1927
1928 extantReleasedChunks = cm.GetExtantReleasedChunks();
1929 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1929); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1929; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1930
1931 // Verify that ReleaseChunk accepts zero chunks.
1932 cm.ReleaseChunk(nullptr);
1933 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1933); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 1933; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1934
1935 // For this test, we need to be able to get at least 2 chunks without hitting
1936 // the limit. (If this failed, it wouldn't necessary be a problem with
1937 // ProfileBufferChunkManagerWithLocalLimit, fiddle with constants at the top
1938 // of this test.)
1939 MOZ_RELEASE_ASSERT(chunkActualBufferBytes < 2 * MaxTotalBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkActualBufferBytes < 2 * MaxTotalBytes)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkActualBufferBytes < 2 * MaxTotalBytes))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes < 2 * MaxTotalBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1939); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes < 2 * MaxTotalBytes"
")"); do { *((volatile int*)__null) = 1939; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1940
1941 unsigned chunk1ReuseCount = 0;
1942
1943 // We will do enough loops to go through the maximum size a number of times.
1944 const unsigned Rollovers = 3;
1945 const unsigned Loops = Rollovers * MaxTotalBytes / chunkActualBufferBytes;
1946 for (unsigned i = 0; i < Loops; ++i) {
1947 // Add some data to the chunk.
1948 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1948); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0"
")"); do { *((volatile int*)__null) = 1948; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1949 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1949); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0"
")"); do { *((volatile int*)__null) = 1949; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1950 MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1950); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0"
")"); do { *((volatile int*)__null) = 1950; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1951 const ProfileBufferIndex index = 1 + i * chunkActualBufferBytes;
1952 chunk->SetRangeStart(index);
1953 MOZ_RELEASE_ASSERT(chunk->RangeStart() == index)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->RangeStart() == index)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == index
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->RangeStart() == index", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1953); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == index"
")"); do { *((volatile int*)__null) = 1953; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1954 Unused << chunk->ReserveInitialBlockAsTail(1);
1955 Unused << chunk->ReserveBlock(2);
1956 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetFirstBlock == 1)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1956); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 1"
")"); do { *((volatile int*)__null) = 1956; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1957 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1957); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2"
")"); do { *((volatile int*)__null) = 1957; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1958
1959 // Request a new chunk.
1960 bool ran = false;
1961 UniquePtr<ProfileBufferChunk> newChunk;
1962 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
1963 ran = true;
1964 newChunk = std::move(aChunk);
1965 });
1966 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 1967; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1967 !ran, "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 1967; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1968 cm.FulfillChunkRequests();
1969 MOZ_RELEASE_ASSERT(ran, "FulfillChunkRequests should invoke the callback")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "FulfillChunkRequests should invoke the callback"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1969); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "FulfillChunkRequests should invoke the callback" ")")
; do { *((volatile int*)__null) = 1969; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1970 MOZ_RELEASE_ASSERT(!!newChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!newChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!newChunk))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!!newChunk" " (" "Chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1970); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!newChunk"
") (" "Chunk request should always work" ")"); do { *((volatile
int*)__null) = 1970; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1971 MOZ_RELEASE_ASSERT(newChunk->BufferBytes() == chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(newChunk->BufferBytes() == chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1972); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1972; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
1972 "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(newChunk->BufferBytes() == chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1972); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 1972; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
1973 MOZ_RELEASE_ASSERT(!newChunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!newChunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!newChunk->GetNext()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!newChunk->GetNext()"
" (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1973); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!newChunk->GetNext()"
") (" "There should only be one chunk" ")"); do { *((volatile
int*)__null) = 1973; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1974
1975 // Mark previous chunk done and release it.
1976 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
1977 chunk->MarkDone();
1978 cm.ReleaseChunk(std::move(chunk));
1979
1980 // And cycle to the new chunk.
1981 chunk = std::move(newChunk);
1982
1983 if (reinterpret_cast<uintptr_t>(chunk.get()) == chunk1Address) {
1984 ++chunk1ReuseCount;
1985 }
1986 }
1987
1988 // Expect all rollovers except 1 to destroy chunks.
1989 MOZ_RELEASE_ASSERT(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes /do { static_assert( mozilla::detail::AssertionConditionType<
decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes
/ chunkActualBufferBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers
- 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
" (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
") (" "Not enough destroyed chunks" ")"); do { *((volatile int
*)__null) = 1991; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
1990 chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes
/ chunkActualBufferBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers
- 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
" (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
") (" "Not enough destroyed chunks" ")"); do { *((volatile int
*)__null) = 1991; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
1991 "Not enough destroyed chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes
/ chunkActualBufferBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers
- 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
" (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes"
") (" "Not enough destroyed chunks" ")"); do { *((volatile int
*)__null) = 1991; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1992 MOZ_RELEASE_ASSERT(destroyedBytes == destroyedChunks * chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(destroyedBytes == destroyedChunks * chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(destroyedBytes == destroyedChunks * chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"destroyedBytes == destroyedChunks * chunkActualBufferBytes" " ("
"Mismatched destroyed chunks and bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1993); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedBytes == destroyedChunks * chunkActualBufferBytes"
") (" "Mismatched destroyed chunks and bytes" ")"); do { *((
volatile int*)__null) = 1993; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
1993 "Mismatched destroyed chunks and bytes")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(destroyedBytes == destroyedChunks * chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(destroyedBytes == destroyedChunks * chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"destroyedBytes == destroyedChunks * chunkActualBufferBytes" " ("
"Mismatched destroyed chunks and bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1993); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedBytes == destroyedChunks * chunkActualBufferBytes"
") (" "Mismatched destroyed chunks and bytes" ")"); do { *((
volatile int*)__null) = 1993; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1994 MOZ_RELEASE_ASSERT(chunk1ReuseCount >= (Rollovers - 1),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk1ReuseCount >= (Rollovers - 1))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunk1ReuseCount >= (Rollovers - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("chunk1ReuseCount >= (Rollovers - 1)"
" (" "Not enough reuse of the first chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk1ReuseCount >= (Rollovers - 1)"
") (" "Not enough reuse of the first chunks" ")"); do { *((volatile
int*)__null) = 1995; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
1995 "Not enough reuse of the first chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk1ReuseCount >= (Rollovers - 1))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(chunk1ReuseCount >= (Rollovers - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("chunk1ReuseCount >= (Rollovers - 1)"
" (" "Not enough reuse of the first chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 1995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk1ReuseCount >= (Rollovers - 1)"
") (" "Not enough reuse of the first chunks" ")"); do { *((volatile
int*)__null) = 1995; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
1996
1997 // Check that chunk manager is reentrant from request callback.
1998 bool ran = false;
1999 bool ranInner = false;
2000 UniquePtr<ProfileBufferChunk> newChunk;
2001 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
2002 ran = true;
2003 MOZ_RELEASE_ASSERT(!!aChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!aChunk" " (" "Chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk"
") (" "Chunk request should always work" ")"); do { *((volatile
int*)__null) = 2003; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2004 Unused << aChunk->ReserveInitialBlockAsTail(0);
2005 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
2006 aChunk->MarkDone();
2007 UniquePtr<ProfileBufferChunk> anotherChunk = cm.GetChunk();
2008 MOZ_RELEASE_ASSERT(!!anotherChunk)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!anotherChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!anotherChunk))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!!anotherChunk"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2008); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!anotherChunk"
")"); do { *((volatile int*)__null) = 2008; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2009 Unused << anotherChunk->ReserveInitialBlockAsTail(0);
2010 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
2011 anotherChunk->MarkDone();
2012 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
2013 ranInner = true;
2014 MOZ_RELEASE_ASSERT(!!aChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!aChunk" " (" "Chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2014); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk"
") (" "Chunk request should always work" ")"); do { *((volatile
int*)__null) = 2014; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2015 Unused << aChunk->ReserveInitialBlockAsTail(0);
2016 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
2017 aChunk->MarkDone();
2018 });
2019 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2020); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 2020; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2020 !ranInner, "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2020); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 2020; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2021 });
2022 MOZ_RELEASE_ASSERT(!ran,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 2023; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2023 "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran"
") (" "RequestChunk should not immediately fulfill the request"
")"); do { *((volatile int*)__null) = 2023; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2024 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "RequestChunk should not immediately fulfill the inner request"
")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2025 !ranInner,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "RequestChunk should not immediately fulfill the inner request"
")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2026 "RequestChunk should not immediately fulfill the inner request")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "RequestChunk should not immediately fulfill the inner request"
")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2027 cm.FulfillChunkRequests();
2028 MOZ_RELEASE_ASSERT(ran, "FulfillChunkRequests should invoke the callback")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "FulfillChunkRequests should invoke the callback"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2028); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "FulfillChunkRequests should invoke the callback" ")")
; do { *((volatile int*)__null) = 2028; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2029 MOZ_RELEASE_ASSERT(!ranInner,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")"); do { *((volatile int*)__null) = 2031
; __attribute__((nomerge)) ::abort(); } while (false); } } while
(false)
2030 "FulfillChunkRequests should not immediately fulfill "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")"); do { *((volatile int*)__null) = 2031
; __attribute__((nomerge)) ::abort(); } while (false); } } while
(false)
2031 "the inner request")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ranInner)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner"
") (" "FulfillChunkRequests should not immediately fulfill "
"the inner request" ")"); do { *((volatile int*)__null) = 2031
; __attribute__((nomerge)) ::abort(); } while (false); } } while
(false)
;
2032 cm.FulfillChunkRequests();
2033 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "2nd FulfillChunkRequests should invoke the inner request callback"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2034); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "2nd FulfillChunkRequests should invoke the inner request callback"
")"); do { *((volatile int*)__null) = 2034; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2034 ran, "2nd FulfillChunkRequests should invoke the inner request callback")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran" " (" "2nd FulfillChunkRequests should invoke the inner request callback"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2034); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
") (" "2nd FulfillChunkRequests should invoke the inner request callback"
")"); do { *((volatile int*)__null) = 2034; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2035
2036 // Enough testing! Clean-up.
2037 Unused << chunk->ReserveInitialBlockAsTail(0);
2038 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
2039 chunk->MarkDone();
2040 cm.ForgetUnreleasedChunks();
2041
2042 // Special testing of the release algorithm, to make sure released chunks get
2043 // sorted.
2044 constexpr unsigned RandomReleaseChunkLoop = 100;
2045 // Build a vector of chunks, and mark them "done", ready to be released.
2046 Vector<UniquePtr<ProfileBufferChunk>> chunksToRelease;
2047 MOZ_RELEASE_ASSERT(chunksToRelease.reserve(RandomReleaseChunkLoop))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunksToRelease.reserve(RandomReleaseChunkLoop))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunksToRelease.reserve(RandomReleaseChunkLoop)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("chunksToRelease.reserve(RandomReleaseChunkLoop)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunksToRelease.reserve(RandomReleaseChunkLoop)"
")"); do { *((volatile int*)__null) = 2047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2048 Vector<TimeStamp> chunksTimeStamps;
2049 MOZ_RELEASE_ASSERT(chunksTimeStamps.reserve(RandomReleaseChunkLoop))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunksTimeStamps.reserve(RandomReleaseChunkLoop))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunksTimeStamps.reserve(RandomReleaseChunkLoop)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("chunksTimeStamps.reserve(RandomReleaseChunkLoop)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunksTimeStamps.reserve(RandomReleaseChunkLoop)"
")"); do { *((volatile int*)__null) = 2049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2050 for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) {
2051 UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk();
2052 MOZ_RELEASE_ASSERT(chunk)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(chunk))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk"
")"); do { *((volatile int*)__null) = 2052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2053 Unused << chunk->ReserveInitialBlockAsTail(0);
2054 chunk->MarkDone();
2055 MOZ_RELEASE_ASSERT(!chunk->ChunkHeader().mDoneTimeStamp.IsNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunk->ChunkHeader().mDoneTimeStamp.IsNull())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!chunk->ChunkHeader().mDoneTimeStamp.IsNull()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->ChunkHeader().mDoneTimeStamp.IsNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2055); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->ChunkHeader().mDoneTimeStamp.IsNull()"
")"); do { *((volatile int*)__null) = 2055; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2056 chunksTimeStamps.infallibleEmplaceBack(chunk->ChunkHeader().mDoneTimeStamp);
2057 chunksToRelease.infallibleEmplaceBack(std::move(chunk));
2058 if (i % 10 == 0) {
2059 // "Done" timestamps should *usually* increase, let's make extra sure some
2060 // timestamps are actually different.
2061 WaitUntilTimeStampChanges();
2062 }
2063 }
2064 // Shuffle the list.
2065 std::random_device randomDevice;
2066 std::mt19937 generator(randomDevice());
2067 std::shuffle(chunksToRelease.begin(), chunksToRelease.end(), generator);
2068 // And release chunks one by one, checking that the list of released chunks
2069 // is always sorted.
2070 printf("TestChunkManagerWithLocalLimit - Shuffle test timestamps:");
2071 for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) {
2072 printf(" %f", (chunksToRelease[i]->ChunkHeader().mDoneTimeStamp -
2073 TimeStamp::ProcessCreation())
2074 .ToMicroseconds());
2075 cm.ReleaseChunk(std::move(chunksToRelease[i]));
2076 cm.PeekExtantReleasedChunks([i](const ProfileBufferChunk* releasedChunks) {
2077 MOZ_RELEASE_ASSERT(releasedChunks)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(releasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(releasedChunks))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("releasedChunks"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2077); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks"
")"); do { *((volatile int*)__null) = 2077; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2078 unsigned releasedChunkCount = 1;
2079 for (;;) {
2080 const ProfileBufferChunk* nextChunk = releasedChunks->GetNext();
2081 if (!nextChunk) {
2082 break;
2083 }
2084 ++releasedChunkCount;
2085 MOZ_RELEASE_ASSERT(releasedChunks->ChunkHeader().mDoneTimeStamp <=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(releasedChunks->ChunkHeader().mDoneTimeStamp <=
nextChunk->ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(releasedChunks->ChunkHeader
().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2086); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2086; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2086 nextChunk->ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(releasedChunks->ChunkHeader().mDoneTimeStamp <=
nextChunk->ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(releasedChunks->ChunkHeader
().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2086); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2086; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2087 releasedChunks = nextChunk;
2088 }
2089 MOZ_RELEASE_ASSERT(releasedChunkCount == i + 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(releasedChunkCount == i + 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(releasedChunkCount == i + 1)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("releasedChunkCount == i + 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2089); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunkCount == i + 1"
")"); do { *((volatile int*)__null) = 2089; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2090 });
2091 }
2092 printf("\n");
2093 // Finally, the whole list of released chunks should have the exact same
2094 // timestamps as the initial list of "done" chunks.
2095 extantReleasedChunks = cm.GetExtantReleasedChunks();
2096 for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) {
2097 MOZ_RELEASE_ASSERT(extantReleasedChunks, "Not enough released chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(extantReleasedChunks))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("extantReleasedChunks"
" (" "Not enough released chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks"
") (" "Not enough released chunks" ")"); do { *((volatile int
*)__null) = 2097; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2098 MOZ_RELEASE_ASSERT(extantReleasedChunks->ChunkHeader().mDoneTimeStamp ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(extantReleasedChunks->ChunkHeader().mDoneTimeStamp
== chunksTimeStamps[i])>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(extantReleasedChunks->ChunkHeader
().mDoneTimeStamp == chunksTimeStamps[i]))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2099); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]"
")"); do { *((volatile int*)__null) = 2099; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2099 chunksTimeStamps[i])do { static_assert( mozilla::detail::AssertionConditionType<
decltype(extantReleasedChunks->ChunkHeader().mDoneTimeStamp
== chunksTimeStamps[i])>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(extantReleasedChunks->ChunkHeader
().mDoneTimeStamp == chunksTimeStamps[i]))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2099); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]"
")"); do { *((volatile int*)__null) = 2099; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2100 Unused << std::exchange(extantReleasedChunks,
2101 extantReleasedChunks->ReleaseNext());
2102 }
2103 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Too many released chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Too many released chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2103); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Too many released chunks" ")"); do { *((volatile int*
)__null) = 2103; __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2104
2105# ifdef DEBUG1
2106 cm.DeregisteredFrom(chunkManagerRegisterer);
2107# endif // DEBUG
2108
2109 printf("TestChunkManagerWithLocalLimit done\n");
2110}
2111
2112static bool IsSameMetadata(
2113 const ProfileBufferControlledChunkManager::ChunkMetadata& a1,
2114 const ProfileBufferControlledChunkManager::ChunkMetadata& a2) {
2115 return a1.mDoneTimeStamp == a2.mDoneTimeStamp &&
2116 a1.mBufferBytes == a2.mBufferBytes;
2117};
2118
2119static bool IsSameUpdate(
2120 const ProfileBufferControlledChunkManager::Update& a1,
2121 const ProfileBufferControlledChunkManager::Update& a2) {
2122 // Final and not-an-update don't carry other data, so we can test these two
2123 // states first.
2124 if (a1.IsFinal() || a2.IsFinal()) {
2125 return a1.IsFinal() && a2.IsFinal();
2126 }
2127 if (a1.IsNotUpdate() || a2.IsNotUpdate()) {
2128 return a1.IsNotUpdate() && a2.IsNotUpdate();
2129 }
2130
2131 // Here, both are "normal" udpates, check member variables:
2132
2133 if (a1.UnreleasedBytes() != a2.UnreleasedBytes()) {
2134 return false;
2135 }
2136 if (a1.ReleasedBytes() != a2.ReleasedBytes()) {
2137 return false;
2138 }
2139 if (a1.OldestDoneTimeStamp() != a2.OldestDoneTimeStamp()) {
2140 return false;
2141 }
2142 if (a1.NewlyReleasedChunksRef().size() !=
2143 a2.NewlyReleasedChunksRef().size()) {
2144 return false;
2145 }
2146 for (unsigned i = 0; i < a1.NewlyReleasedChunksRef().size(); ++i) {
2147 if (!IsSameMetadata(a1.NewlyReleasedChunksRef()[i],
2148 a2.NewlyReleasedChunksRef()[i])) {
2149 return false;
2150 }
2151 }
2152 return true;
2153}
2154
2155static void TestControlledChunkManagerUpdate() {
2156 printf("TestControlledChunkManagerUpdate...\n");
2157
2158 using Update = ProfileBufferControlledChunkManager::Update;
2159
2160 // Default construction.
2161 Update update1;
2162 MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2162); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2162; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2163 MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2163); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2163; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2164
2165 // Clear an already-cleared update.
2166 update1.Clear();
2167 MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2167); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2167; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2168 MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2168); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2168; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2169
2170 // Final construction with nullptr.
2171 const Update final(nullptr);
2172 MOZ_RELEASE_ASSERT(final.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(final.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(final.IsFinal()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("final.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2172); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "final.IsFinal()"
")"); do { *((volatile int*)__null) = 2172; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2173 MOZ_RELEASE_ASSERT(!final.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!final.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!final.IsNotUpdate()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!final.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2173); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!final.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2173; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2174
2175 // Copy final to cleared.
2176 update1 = final;
2177 MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2177); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2177; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2178 MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2178); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2178; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2179
2180 // Copy final to final.
2181 update1 = final;
2182 MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2182); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2182; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2183 MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2183); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2183; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2184
2185 // Clear a final update.
2186 update1.Clear();
2187 MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2187; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2188 MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2188); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2188; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2189
2190 // Move final to cleared.
2191 update1 = Update(nullptr);
2192 MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2192); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2192; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2193 MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2193); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2193; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2194
2195 // Move final to final.
2196 update1 = Update(nullptr);
2197 MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2197); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2197; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2198 MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2199
2200 // Move from not-an-update (effectively same as Clear).
2201 update1 = Update();
2202 MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2202); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2202; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2203 MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2203); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2203; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2204
2205 auto CreateBiggerChunkAfter = [](const ProfileBufferChunk& aChunkToBeat) {
2206 while (TimeStamp::Now() <= aChunkToBeat.ChunkHeader().mDoneTimeStamp) {
2207 ::SleepMilli(1);
2208 }
2209 auto chunk = ProfileBufferChunk::Create(aChunkToBeat.BufferBytes() * 2);
2210 MOZ_RELEASE_ASSERT(!!chunk)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2210); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
")"); do { *((volatile int*)__null) = 2210; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2211 MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->BufferBytes() >= aChunkToBeat.BufferBytes
() * 2)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunk->BufferBytes() >= aChunkToBeat.BufferBytes
() * 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2211); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2"
")"); do { *((volatile int*)__null) = 2211; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2212 Unused << chunk->ReserveInitialBlockAsTail(0);
2213 chunk->MarkDone();
2214 MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mDoneTimeStamp >do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat
.ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->ChunkHeader().mDoneTimeStamp
> aChunkToBeat.ChunkHeader().mDoneTimeStamp))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2215); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2215; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2215 aChunkToBeat.ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat
.ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunk->ChunkHeader().mDoneTimeStamp
> aChunkToBeat.ChunkHeader().mDoneTimeStamp))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2215); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2215; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2216 return chunk;
2217 };
2218
2219 update1 = Update(1, 2, nullptr, nullptr);
2220
2221 // Create initial update with 2 released chunks and 1 unreleased chunk.
2222 auto released = ProfileBufferChunk::Create(10);
2223 ProfileBufferChunk* c1 = released.get();
2224 Unused << c1->ReserveInitialBlockAsTail(0);
2225 c1->MarkDone();
2226
2227 released->SetLast(CreateBiggerChunkAfter(*c1));
2228 ProfileBufferChunk* c2 = c1->GetNext();
2229
2230 auto unreleased = CreateBiggerChunkAfter(*c2);
2231 ProfileBufferChunk* c3 = unreleased.get();
2232
2233 Update update2(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1,
2234 c1);
2235 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2236 update2,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2237 Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2238 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2239 {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2240 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2241 // Check every field, this time only, after that we'll trust that the
2242 // `SameUpdate` test will be enough.
2243 MOZ_RELEASE_ASSERT(!update2.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update2.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update2.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update2.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update2.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2243; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2244 MOZ_RELEASE_ASSERT(!update2.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update2.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update2.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update2.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2244); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update2.IsFinal()"
")"); do { *((volatile int*)__null) = 2244; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2245 MOZ_RELEASE_ASSERT(update2.UnreleasedBytes() == c3->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.UnreleasedBytes() == c3->BufferBytes())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update2.UnreleasedBytes() == c3->BufferBytes())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.UnreleasedBytes() == c3->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.UnreleasedBytes() == c3->BufferBytes()"
")"); do { *((volatile int*)__null) = 2245; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2246 MOZ_RELEASE_ASSERT(update2.ReleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.ReleasedBytes() == c1->BufferBytes() + c2
->BufferBytes())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update2.ReleasedBytes() == c1
->BufferBytes() + c2->BufferBytes()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2247); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()"
")"); do { *((volatile int*)__null) = 2247; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2247 c1->BufferBytes() + c2->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.ReleasedBytes() == c1->BufferBytes() + c2
->BufferBytes())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update2.ReleasedBytes() == c1
->BufferBytes() + c2->BufferBytes()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2247); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()"
")"); do { *((volatile int*)__null) = 2247; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2248 MOZ_RELEASE_ASSERT(update2.OldestDoneTimeStamp() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.OldestDoneTimeStamp() == c1->ChunkHeader(
).mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update2.OldestDoneTimeStamp(
) == c1->ChunkHeader().mDoneTimeStamp))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2249 c1->ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.OldestDoneTimeStamp() == c1->ChunkHeader(
).mDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update2.OldestDoneTimeStamp(
) == c1->ChunkHeader().mDoneTimeStamp))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2250 MOZ_RELEASE_ASSERT(update2.NewlyReleasedChunksRef().size() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update2.NewlyReleasedChunksRef().size() == 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(update2.NewlyReleasedChunksRef().size() == 2))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("update2.NewlyReleasedChunksRef().size() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.NewlyReleasedChunksRef().size() == 2"
")"); do { *((volatile int*)__null) = 2250; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2251 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2252 IsSameMetadata(update2.NewlyReleasedChunksRef()[0],do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2253 {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {
c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2254 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2255 IsSameMetadata(update2.NewlyReleasedChunksRef()[1],do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2256 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {
c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})"
")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2257
2258 // Fold into not-an-update.
2259 update1.Fold(std::move(update2));
2260 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2261 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2262 Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2263 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2264 {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2265 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2266
2267 // Pretend nothing happened.
2268 update2 = Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1,
2269 nullptr);
2270 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2271 update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2272 c1->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2273 update1.Fold(std::move(update2));
2274 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2275 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2276 Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2277 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2278 {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2279 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader
().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->
BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2280
2281 // Pretend there's a new unreleased chunk.
2282 c3->SetLast(CreateBiggerChunkAfter(*c3));
2283 ProfileBufferChunk* c4 = c3->GetNext();
2284 update2 = Update(c3->BufferBytes() + c4->BufferBytes(),
2285 c1->BufferBytes() + c2->BufferBytes(), c1, nullptr);
2286 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4
->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2287 IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4
->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2288 c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4
->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2289 c1->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4
->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2290 update1.Fold(std::move(update2));
2291 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2292 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2293 Update(c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2294 c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2295 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2296 {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2297 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c3->BufferBytes() +
c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes
() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2298
2299 // Pretend the first unreleased chunk c3 has been released.
2300 released->SetLast(std::exchange(unreleased, unreleased->ReleaseNext()));
2301 update2 =
2302 Update(c4->BufferBytes(),
2303 c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1, c3);
2304 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2305 update2,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2306 Update(c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2307 c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2308 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2309 {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2310 update1.Fold(std::move(update2));
2311 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2312 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2313 Update(c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2314 c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2315 c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2316 {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2317 {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2318 {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1
->BufferBytes() + c2->BufferBytes() + c3->BufferBytes
(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader
().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes
() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp
, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()
}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()
}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()
}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2319
2320 // Pretend c1 has been destroyed, so the oldest timestamp is now at c2.
2321 released = released->ReleaseNext();
2322 c1 = nullptr;
2323 update2 = Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2,
2324 nullptr);
2325 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2326 update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2327 c2->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))"
")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2328 update1.Fold(std::move(update2));
2329 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2330 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2331 Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2332 c2->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2333 {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2334 {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2
->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader
().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->
BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes
(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader
().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2335
2336 // Pretend c2 has been recycled to make unreleased c5, and c4 has been
2337 // released.
2338 auto recycled = std::exchange(released, released->ReleaseNext());
2339 recycled->MarkRecycled();
2340 Unused << recycled->ReserveInitialBlockAsTail(0);
2341 recycled->MarkDone();
2342 released->SetLast(std::move(unreleased));
2343 unreleased = std::move(recycled);
2344 ProfileBufferChunk* c5 = c2;
2345 c2 = nullptr;
2346 update2 =
2347 Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3, c4);
2348 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2349 update2,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2350 Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2351 c3->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2352 {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2353 update1.Fold(std::move(update2));
2354 MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2355 update1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2356 Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2357 c3->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2358 {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2359 {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3
->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader
().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->
BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->
BufferBytes()}})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update
(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes
(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader
().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader
().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))"
")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2360
2361 // And send a final update.
2362 update1.Fold(Update(nullptr));
2363 MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update1.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()"
")"); do { *((volatile int*)__null) = 2363; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2364 MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2364); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2364; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2365
2366 printf("TestControlledChunkManagerUpdate done\n");
2367}
2368
2369static void TestControlledChunkManagerWithLocalLimit() {
2370 printf("TestControlledChunkManagerWithLocalLimit...\n");
2371
2372 // Construct a ProfileBufferChunkManagerWithLocalLimit with chunk of minimum
2373 // size >=100, up to 1000 bytes.
2374 constexpr ProfileBufferChunk::Length MaxTotalBytes = 1000;
2375 constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 100;
2376 ProfileBufferChunkManagerWithLocalLimit cmll{MaxTotalBytes,
2377 ChunkMinBufferBytes};
2378
2379 // Reference to chunk manager base class.
2380 ProfileBufferChunkManager& cm = cmll;
2381
2382 // Reference to controlled chunk manager base class.
2383 ProfileBufferControlledChunkManager& ccm = cmll;
2384
2385# ifdef DEBUG1
2386 const char* chunkManagerRegisterer =
2387 "TestControlledChunkManagerWithLocalLimit";
2388 cm.RegisteredWith(chunkManagerRegisterer);
2389# endif // DEBUG
2390
2391 MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == MaxTotalBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2392); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes"
") (" "Max total size should be exactly as given" ")"); do {
*((volatile int*)__null) = 2392; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
2392 "Max total size should be exactly as given")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2392); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes"
") (" "Max total size should be exactly as given" ")"); do {
*((volatile int*)__null) = 2392; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
2393
2394 unsigned destroyedChunks = 0;
2395 unsigned destroyedBytes = 0;
2396 cm.SetChunkDestroyedCallback([&](const ProfileBufferChunk& aChunks) {
2397 for (const ProfileBufferChunk* chunk = &aChunks; chunk;
2398 chunk = chunk->GetNext()) {
2399 destroyedChunks += 1;
2400 destroyedBytes += chunk->BufferBytes();
2401 }
2402 });
2403
2404 using Update = ProfileBufferControlledChunkManager::Update;
2405 unsigned updateCount = 0;
2406 ProfileBufferControlledChunkManager::Update update;
2407 MOZ_RELEASE_ASSERT(update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update.IsNotUpdate()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("update.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2407); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2407; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2408 auto updateCallback = [&](Update&& aUpdate) {
2409 ++updateCount;
2410 update.Fold(std::move(aUpdate));
2411 };
2412 ccm.SetUpdateCallback(updateCallback);
2413 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "SetUpdateCallback should have triggered an update" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "SetUpdateCallback should have triggered an update" ")"
); do { *((volatile int*)__null) = 2414; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2414 "SetUpdateCallback should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "SetUpdateCallback should have triggered an update" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "SetUpdateCallback should have triggered an update" ")"
); do { *((volatile int*)__null) = 2414; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2415 MOZ_RELEASE_ASSERT(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2415); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2415; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2416 updateCount = 0;
2417 update.Clear();
2418
2419 UniquePtr<ProfileBufferChunk> extantReleasedChunks =
2420 cm.GetExtantReleasedChunks();
2421 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2421); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 2421; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2422 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetExtantReleasedChunks should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2423); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetExtantReleasedChunks should have triggered an update"
")"); do { *((volatile int*)__null) = 2423; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2423 "GetExtantReleasedChunks should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetExtantReleasedChunks should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2423); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetExtantReleasedChunks should have triggered an update"
")"); do { *((volatile int*)__null) = 2423; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2424 MOZ_RELEASE_ASSERT(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2424); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2424; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2425 updateCount = 0;
2426 update.Clear();
2427
2428 // First request.
2429 UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk();
2430 MOZ_RELEASE_ASSERT(!!chunk,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2431); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk immediate request should always work" ")"
); do { *((volatile int*)__null) = 2431; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2431 "First chunk immediate request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2431); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk"
") (" "First chunk immediate request should always work" ")"
); do { *((volatile int*)__null) = 2431; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2432 const auto chunkActualBufferBytes = chunk->BufferBytes();
2433 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetChunk should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2434); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetChunk should have triggered an update" ")"); do { *
((volatile int*)__null) = 2434; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
2434 "GetChunk should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetChunk should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2434); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetChunk should have triggered an update" ")"); do { *
((volatile int*)__null) = 2434; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2435 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(chunk->BufferBytes(),
0, TimeStamp{}, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update(
chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2436); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2436; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2436 IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(chunk->BufferBytes(),
0, TimeStamp{}, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update(
chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2436); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2436; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2437 updateCount = 0;
2438 update.Clear();
2439
2440 extantReleasedChunks = cm.GetExtantReleasedChunks();
2441 MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks"
" (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2441); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks"
") (" "Unexpected released chunk(s)" ")"); do { *((volatile int
*)__null) = 2441; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2442 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetExtantReleasedChunks should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2443); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetExtantReleasedChunks should have triggered an update"
")"); do { *((volatile int*)__null) = 2443; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2443 "GetExtantReleasedChunks should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "GetExtantReleasedChunks should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2443); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "GetExtantReleasedChunks should have triggered an update"
")"); do { *((volatile int*)__null) = 2443; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2444 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(chunk->BufferBytes(),
0, TimeStamp{}, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update(
chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2445; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2445 IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSameUpdate(update, Update(chunk->BufferBytes(),
0, TimeStamp{}, {})))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update(
chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))"
")"); do { *((volatile int*)__null) = 2445; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2446 updateCount = 0;
2447 update.Clear();
2448
2449 // For this test, we need to be able to get at least 2 chunks without hitting
2450 // the limit. (If this failed, it wouldn't necessary be a problem with
2451 // ProfileBufferChunkManagerWithLocalLimit, fiddle with constants at the top
2452 // of this test.)
2453 MOZ_RELEASE_ASSERT(chunkActualBufferBytes < 2 * MaxTotalBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkActualBufferBytes < 2 * MaxTotalBytes)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunkActualBufferBytes < 2 * MaxTotalBytes))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes < 2 * MaxTotalBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2453); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes < 2 * MaxTotalBytes"
")"); do { *((volatile int*)__null) = 2453; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2454
2455 ProfileBufferChunk::Length previousUnreleasedBytes = chunk->BufferBytes();
2456 ProfileBufferChunk::Length previousReleasedBytes = 0;
2457 TimeStamp previousOldestDoneTimeStamp;
2458
2459 // We will do enough loops to go through the maximum size a number of times.
2460 const unsigned Rollovers = 3;
2461 const unsigned Loops = Rollovers * MaxTotalBytes / chunkActualBufferBytes;
2462 for (unsigned i = 0; i < Loops; ++i) {
2463 // Add some data to the chunk.
2464 const ProfileBufferIndex index =
2465 ProfileBufferIndex(chunkActualBufferBytes) * i + 1;
2466 chunk->SetRangeStart(index);
2467 Unused << chunk->ReserveInitialBlockAsTail(1);
2468 Unused << chunk->ReserveBlock(2);
2469
2470 // Request a new chunk.
2471 UniquePtr<ProfileBufferChunk> newChunk;
2472 cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) {
2473 newChunk = std::move(aChunk);
2474 });
2475 MOZ_RELEASE_ASSERT(updateCount == 0,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 0))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 0"
" (" "RequestChunk() shouldn't have triggered an update" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 0"
") (" "RequestChunk() shouldn't have triggered an update" ")"
); do { *((volatile int*)__null) = 2476; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2476 "RequestChunk() shouldn't have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 0))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 0"
" (" "RequestChunk() shouldn't have triggered an update" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 0"
") (" "RequestChunk() shouldn't have triggered an update" ")"
); do { *((volatile int*)__null) = 2476; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2477 cm.FulfillChunkRequests();
2478 MOZ_RELEASE_ASSERT(!!newChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!newChunk)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!newChunk))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!!newChunk" " (" "Chunk request should always work"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2478); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!newChunk"
") (" "Chunk request should always work" ")"); do { *((volatile
int*)__null) = 2478; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2479 MOZ_RELEASE_ASSERT(newChunk->BufferBytes() == chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(newChunk->BufferBytes() == chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 2480; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
2480 "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(newChunk->BufferBytes() == chunkActualBufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes"
") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null
) = 2480; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
2481 MOZ_RELEASE_ASSERT(!newChunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!newChunk->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!newChunk->GetNext()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!newChunk->GetNext()"
" (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2481); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!newChunk->GetNext()"
") (" "There should only be one chunk" ")"); do { *((volatile
int*)__null) = 2481; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2482
2483 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "FulfillChunkRequests() after a request should have " "triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "FulfillChunkRequests() after a request should have " "triggered an update"
")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2484 "FulfillChunkRequests() after a request should have "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "FulfillChunkRequests() after a request should have " "triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "FulfillChunkRequests() after a request should have " "triggered an update"
")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2485 "triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "FulfillChunkRequests() after a request should have " "triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "FulfillChunkRequests() after a request should have " "triggered an update"
")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2486 MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2486); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()"
")"); do { *((volatile int*)__null) = 2486; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2487 MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2487); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2487; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2488 MOZ_RELEASE_ASSERT(update.UnreleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.UnreleasedBytes() == previousUnreleasedBytes +
newChunk->BufferBytes())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes
+ newChunk->BufferBytes()))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2489); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()"
")"); do { *((volatile int*)__null) = 2489; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2489 previousUnreleasedBytes + newChunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.UnreleasedBytes() == previousUnreleasedBytes +
newChunk->BufferBytes())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes
+ newChunk->BufferBytes()))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2489); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()"
")"); do { *((volatile int*)__null) = 2489; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2490 previousUnreleasedBytes = update.UnreleasedBytes();
2491 MOZ_RELEASE_ASSERT(update.ReleasedBytes() <= previousReleasedBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.ReleasedBytes() <= previousReleasedBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.ReleasedBytes() <= previousReleasedBytes))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.ReleasedBytes() <= previousReleasedBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2491); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() <= previousReleasedBytes"
")"); do { *((volatile int*)__null) = 2491; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2492 previousReleasedBytes = update.ReleasedBytes();
2493 MOZ_RELEASE_ASSERT(previousOldestDoneTimeStamp.IsNull() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2494 update.OldestDoneTimeStamp() >=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2495 previousOldestDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2496 previousOldestDoneTimeStamp = update.OldestDoneTimeStamp();
2497 MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().empty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef().empty())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(update.NewlyReleasedChunksRef().empty()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().empty()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2497); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().empty()"
")"); do { *((volatile int*)__null) = 2497; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2498 updateCount = 0;
2499 update.Clear();
2500
2501 // Make sure the "Done" timestamp below cannot be the same as from the
2502 // previous loop.
2503 const TimeStamp now = TimeStamp::Now();
2504 while (TimeStamp::Now() == now) {
2505 ::SleepMilli(1);
2506 }
2507
2508 // Mark previous chunk done and release it.
2509 WaitUntilTimeStampChanges(); // Force "done" timestamp to change.
2510 chunk->MarkDone();
2511 const auto doneTimeStamp = chunk->ChunkHeader().mDoneTimeStamp;
2512 const auto bufferBytes = chunk->BufferBytes();
2513 cm.ReleaseChunk(std::move(chunk));
2514
2515 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "ReleaseChunk() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "ReleaseChunk() should have triggered an update" ")");
do { *((volatile int*)__null) = 2516; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2516 "ReleaseChunk() should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "ReleaseChunk() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "ReleaseChunk() should have triggered an update" ")");
do { *((volatile int*)__null) = 2516; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2517 MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2517); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()"
")"); do { *((volatile int*)__null) = 2517; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2518 MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2518); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2518; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2519 MOZ_RELEASE_ASSERT(update.UnreleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.UnreleasedBytes() == previousUnreleasedBytes -
bufferBytes)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes
- bufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes"
")"); do { *((volatile int*)__null) = 2520; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2520 previousUnreleasedBytes - bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.UnreleasedBytes() == previousUnreleasedBytes -
bufferBytes)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes
- bufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes"
")"); do { *((volatile int*)__null) = 2520; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2521 previousUnreleasedBytes = update.UnreleasedBytes();
2522 MOZ_RELEASE_ASSERT(update.ReleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.ReleasedBytes() == previousReleasedBytes + bufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.ReleasedBytes() == previousReleasedBytes + bufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"update.ReleasedBytes() == previousReleasedBytes + bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes + bufferBytes"
")"); do { *((volatile int*)__null) = 2523; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2523 previousReleasedBytes + bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.ReleasedBytes() == previousReleasedBytes + bufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.ReleasedBytes() == previousReleasedBytes + bufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"update.ReleasedBytes() == previousReleasedBytes + bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes + bufferBytes"
")"); do { *((volatile int*)__null) = 2523; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2524 previousReleasedBytes = update.ReleasedBytes();
2525 MOZ_RELEASE_ASSERT(previousOldestDoneTimeStamp.IsNull() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2526 update.OldestDoneTimeStamp() >=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2527 previousOldestDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp
() >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp.
IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp"
")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2528 previousOldestDoneTimeStamp = update.OldestDoneTimeStamp();
2529 MOZ_RELEASE_ASSERT(update.OldestDoneTimeStamp() <= doneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.OldestDoneTimeStamp() <= doneTimeStamp)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.OldestDoneTimeStamp() <= doneTimeStamp))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("update.OldestDoneTimeStamp() <= doneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2529); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.OldestDoneTimeStamp() <= doneTimeStamp"
")"); do { *((volatile int*)__null) = 2529; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2530 MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().size() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef().size() == 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(update.NewlyReleasedChunksRef().size() == 1))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().size() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2530); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().size() == 1"
")"); do { *((volatile int*)__null) = 2530; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2531 MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp ==
doneTimeStamp)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(update.NewlyReleasedChunksRef(
)[0].mDoneTimeStamp == doneTimeStamp))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp"
")"); do { *((volatile int*)__null) = 2532; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2532 doneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp ==
doneTimeStamp)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(update.NewlyReleasedChunksRef(
)[0].mDoneTimeStamp == doneTimeStamp))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp"
")"); do { *((volatile int*)__null) = 2532; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2533 MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef()[0].mBufferBytes ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes"
")"); do { *((volatile int*)__null) = 2534; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2534 bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes"
")"); do { *((volatile int*)__null) = 2534; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2535 updateCount = 0;
2536 update.Clear();
2537
2538 // And cycle to the new chunk.
2539 chunk = std::move(newChunk);
2540 }
2541
2542 // Enough testing! Clean-up.
2543 Unused << chunk->ReserveInitialBlockAsTail(0);
2544 chunk->MarkDone();
2545 cm.ForgetUnreleasedChunks();
2546 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "ForgetUnreleasedChunks() should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "ForgetUnreleasedChunks() should have triggered an update"
")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2547 updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "ForgetUnreleasedChunks() should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "ForgetUnreleasedChunks() should have triggered an update"
")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2548 "ForgetUnreleasedChunks() should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "ForgetUnreleasedChunks() should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "ForgetUnreleasedChunks() should have triggered an update"
")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2549 MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2549); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()"
")"); do { *((volatile int*)__null) = 2549; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2550 MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()"
")"); do { *((volatile int*)__null) = 2550; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2551 MOZ_RELEASE_ASSERT(update.UnreleasedBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.UnreleasedBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"update.UnreleasedBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2551); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == 0"
")"); do { *((volatile int*)__null) = 2551; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2552 MOZ_RELEASE_ASSERT(update.ReleasedBytes() == previousReleasedBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.ReleasedBytes() == previousReleasedBytes)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(update.ReleasedBytes() == previousReleasedBytes))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("update.ReleasedBytes() == previousReleasedBytes"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2552); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes"
")"); do { *((volatile int*)__null) = 2552; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2553 MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().empty() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.NewlyReleasedChunksRef().empty() == 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(update.NewlyReleasedChunksRef().empty() == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().empty() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().empty() == 1"
")"); do { *((volatile int*)__null) = 2553; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2554 updateCount = 0;
2555 update.Clear();
2556
2557 ccm.SetUpdateCallback({});
2558 MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "SetUpdateCallback({}) should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "SetUpdateCallback({}) should have triggered an update"
")"); do { *((volatile int*)__null) = 2559; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2559 "SetUpdateCallback({}) should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(updateCount == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("updateCount == 1"
" (" "SetUpdateCallback({}) should have triggered an update"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1"
") (" "SetUpdateCallback({}) should have triggered an update"
")"); do { *((volatile int*)__null) = 2559; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2560 MOZ_RELEASE_ASSERT(update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(update.IsFinal())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(update.IsFinal()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("update.IsFinal()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2560); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.IsFinal()"
")"); do { *((volatile int*)__null) = 2560; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2561
2562# ifdef DEBUG1
2563 cm.DeregisteredFrom(chunkManagerRegisterer);
2564# endif // DEBUG
2565
2566 printf("TestControlledChunkManagerWithLocalLimit done\n");
2567}
2568
2569# define VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED( \{ ProfileChunkedBuffer::State state = (aProfileChunkedBuffer)
.GetState(); do { static_assert( mozilla::detail::AssertionConditionType
<decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (aEnd))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd)))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (aPushed))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (aPushed
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (aCleared))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (aCleared
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mClearedBlockCount == (aCleared)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (aFailed))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2570 aProfileChunkedBuffer, aStart, aEnd, aPushed, aCleared, aFailed){ ProfileChunkedBuffer::State state = (aProfileChunkedBuffer)
.GetState(); do { static_assert( mozilla::detail::AssertionConditionType
<decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (aEnd))>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd)))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (aPushed))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (aPushed
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (aCleared))>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (aCleared
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mClearedBlockCount == (aCleared)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (aFailed))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)"
")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
\
2571 { \
2572 ProfileChunkedBuffer::State state = (aProfileChunkedBuffer).GetState(); \
2573 MOZ_RELEASE_ASSERT(state.mRangeStart == (aStart))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2573); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)"
")"); do { *((volatile int*)__null) = 2573; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2574 MOZ_RELEASE_ASSERT(state.mRangeEnd == (aEnd))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeEnd == (aEnd))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2574); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)"
")"); do { *((volatile int*)__null) = 2574; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2575 MOZ_RELEASE_ASSERT(state.mPushedBlockCount == (aPushed))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mPushedBlockCount == (aPushed))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
aPushed)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2575); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)"
")"); do { *((volatile int*)__null) = 2575; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2576 MOZ_RELEASE_ASSERT(state.mClearedBlockCount == (aCleared))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mClearedBlockCount == (aCleared))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mClearedBlockCount == (aCleared)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (aCleared)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2576); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)"
")"); do { *((volatile int*)__null) = 2576; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2577 MOZ_RELEASE_ASSERT(state.mFailedPutBytes == (aFailed))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mFailedPutBytes == (aFailed))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2577); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)"
")"); do { *((volatile int*)__null) = 2577; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2578 }
2579
2580static void TestChunkedBuffer() {
2581 printf("TestChunkedBuffer...\n");
2582
2583 ProfileBufferBlockIndex blockIndex;
2584 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2584); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 2584; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2585 MOZ_RELEASE_ASSERT(blockIndex == nullptr)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(blockIndex == nullptr)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(blockIndex == nullptr))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex == nullptr"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2585); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex == nullptr"
")"); do { *((volatile int*)__null) = 2585; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2586
2587 // Create an out-of-session ProfileChunkedBuffer.
2588 ProfileChunkedBuffer cb(ProfileChunkedBuffer::ThreadSafety::WithMutex);
2589
2590 MOZ_RELEASE_ASSERT(cb.BufferLength().isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.BufferLength().isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cb.BufferLength().isNothing(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.BufferLength().isNothing()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2590); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.BufferLength().isNothing()"
")"); do { *((volatile int*)__null) = 2590; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2591
2592 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2593
2594 int result = 0;
2595 result = cb.ReserveAndPut(
2596 []() {
2597 MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2597); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 2597; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2598 return 1;
2599 },
2600 [](Maybe<ProfileBufferEntryWriter>& aEW) { return aEW ? 2 : 3; });
2601 MOZ_RELEASE_ASSERT(result == 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 3)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 3", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 3"
")"); do { *((volatile int*)__null) = 2601; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2602 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2603
2604 result = 0;
2605 result = cb.Put(
2606 1, [](Maybe<ProfileBufferEntryWriter>& aEW) { return aEW ? 1 : 2; });
2607 MOZ_RELEASE_ASSERT(result == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2607); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 2"
")"); do { *((volatile int*)__null) = 2607; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2608 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2609
2610 blockIndex = cb.PutFrom(&result, 1);
2611 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2611); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 2611; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2612 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2613
2614 blockIndex = cb.PutObjects(123, result, "hello");
2615 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 2615; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2616 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2617
2618 blockIndex = cb.PutObject(123);
2619 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 2619; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2620 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2621
2622 auto chunks = cb.GetAllChunks();
2623 static_assert(std::is_same_v<decltype(chunks), UniquePtr<ProfileBufferChunk>>,
2624 "ProfileChunkedBuffer::GetAllChunks() should return a "
2625 "UniquePtr<ProfileBufferChunk>");
2626 MOZ_RELEASE_ASSERT(!chunks, "Expected no chunks when out-of-session")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunks))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!chunks" " (" "Expected no chunks when out-of-session"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2626); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks"
") (" "Expected no chunks when out-of-session" ")"); do { *(
(volatile int*)__null) = 2626; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2627
2628 bool ran = false;
2629 result = 0;
2630 result = cb.Read([&](ProfileChunkedBuffer::Reader* aReader) {
2631 ran = true;
2632 MOZ_RELEASE_ASSERT(!aReader)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aReader)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aReader))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!aReader", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2632); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!aReader"
")"); do { *((volatile int*)__null) = 2632; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2633 return 3;
2634 });
2635 MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2635); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
")"); do { *((volatile int*)__null) = 2635; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2636 MOZ_RELEASE_ASSERT(result == 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 3)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 3", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2636); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 3"
")"); do { *((volatile int*)__null) = 2636; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2637
2638 cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2638); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 2638; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
2639
2640 result = 0;
2641 result = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) {
2642 MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("er.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()"
")"); do { *((volatile int*)__null) = 2642; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2643 return 4;
2644 });
2645 MOZ_RELEASE_ASSERT(result == 4)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 4)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 4))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2645); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 4"
")"); do { *((volatile int*)__null) = 2645; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2646
2647 // Use ProfileBufferChunkManagerWithLocalLimit, which will give away
2648 // ProfileBufferChunks that can contain 128 bytes, using up to 1KB of memory
2649 // (including usable 128 bytes and headers).
2650 constexpr size_t bufferMaxSize = 1024;
2651 constexpr ProfileChunkedBuffer::Length chunkMinSize = 128;
2652 ProfileBufferChunkManagerWithLocalLimit cm(bufferMaxSize, chunkMinSize);
2653 cb.SetChunkManager(cm);
2654 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2655
2656 // Let the chunk manager fulfill the initial request for an extra chunk.
2657 cm.FulfillChunkRequests();
2658
2659 MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == bufferMaxSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cm.MaxTotalSize() == bufferMaxSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == bufferMaxSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cm.MaxTotalSize() == bufferMaxSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2659); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == bufferMaxSize"
")"); do { *((volatile int*)__null) = 2659; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2660 MOZ_RELEASE_ASSERT(cb.BufferLength().isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.BufferLength().isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cb.BufferLength().isSome()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cb.BufferLength().isSome()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2660); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.BufferLength().isSome()"
")"); do { *((volatile int*)__null) = 2660; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2661 MOZ_RELEASE_ASSERT(*cb.BufferLength() == bufferMaxSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*cb.BufferLength() == bufferMaxSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*cb.BufferLength() == bufferMaxSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"*cb.BufferLength() == bufferMaxSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2661); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*cb.BufferLength() == bufferMaxSize"
")"); do { *((volatile int*)__null) = 2661; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2662 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2663
2664 // Write an int with the main `ReserveAndPut` function.
2665 const int test = 123;
2666 ran = false;
2667 blockIndex = nullptr;
2668 bool success = cb.ReserveAndPut(
2669 []() { return sizeof(test); },
2670 [&](Maybe<ProfileBufferEntryWriter>& aEW) {
2671 ran = true;
2672 if (!aEW) {
2673 return false;
2674 }
2675 blockIndex = aEW->CurrentBlockIndex();
2676 MOZ_RELEASE_ASSERT(aEW->RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW->RemainingBytes() == sizeof(test))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(aEW->RemainingBytes() == sizeof(test)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("aEW->RemainingBytes() == sizeof(test)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2676); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW->RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2676; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2677 aEW->WriteObject(test);
2678 MOZ_RELEASE_ASSERT(aEW->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW->RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW->RemainingBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aEW->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2678); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW->RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2678; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2679 return true;
2680 });
2681 MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
")"); do { *((volatile int*)__null) = 2681; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2682 MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success"
")"); do { *((volatile int*)__null) = 2682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2683 MOZ_RELEASE_ASSERT(blockIndex.ConvertToProfileBufferIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(blockIndex.ConvertToProfileBufferIndex() == 1)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(blockIndex.ConvertToProfileBufferIndex() == 1))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex.ConvertToProfileBufferIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex.ConvertToProfileBufferIndex() == 1"
")"); do { *((volatile int*)__null) = 2683; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2684 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof
(test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2685 cb, 1, 1 + ULEB128Size(sizeof(test)) + sizeof(test), 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof
(test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2686
2687 ran = false;
2688 result = 0;
2689 result = cb.Read([&](ProfileChunkedBuffer::Reader* aReader) {
2690 ran = true;
2691 MOZ_RELEASE_ASSERT(!!aReader)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aReader)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aReader))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!aReader", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2691); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aReader"
")"); do { *((volatile int*)__null) = 2691; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2692 // begin() and end() should be at the range edges (verified above).
2693 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2694 aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2695 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1"
")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2696 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0"
")"); do { *((volatile int*)__null) = 2697; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2697 aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex
() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0"
")"); do { *((volatile int*)__null) = 2697; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2698 // Null ProfileBufferBlockIndex clamped to the beginning.
2699 MOZ_RELEASE_ASSERT(aReader->At(nullptr) == aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(nullptr) == aReader->begin())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->At(nullptr) == aReader->begin()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(nullptr) == aReader->begin()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(nullptr) == aReader->begin()"
")"); do { *((volatile int*)__null) = 2699; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2700 MOZ_RELEASE_ASSERT(aReader->At(blockIndex) == aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(blockIndex) == aReader->begin())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aReader->At(blockIndex) == aReader->begin())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(blockIndex) == aReader->begin()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(blockIndex) == aReader->begin()"
")"); do { *((volatile int*)__null) = 2700; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2701 // At(begin) same as begin().
2702 MOZ_RELEASE_ASSERT(aReader->At(aReader->begin().CurrentBlockIndex()) ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(aReader->begin().CurrentBlockIndex
()) == aReader->begin())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aReader->At(aReader->begin
().CurrentBlockIndex()) == aReader->begin()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()"
")"); do { *((volatile int*)__null) = 2703; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2703 aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(aReader->begin().CurrentBlockIndex
()) == aReader->begin())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aReader->At(aReader->begin
().CurrentBlockIndex()) == aReader->begin()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()"
")"); do { *((volatile int*)__null) = 2703; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2704 // At(past block) same as end().
2705 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex
( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex
::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader
->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2706 aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex
( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex
::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader
->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2707 1 + 1 + sizeof(test))) == aReader->end())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex
( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex
::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader
->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()"
")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2708
2709 size_t read = 0;
2710 aReader->ForEach([&](ProfileBufferEntryReader& er) {
2711 ++read;
2712 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof
(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2712); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2712; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2713 const auto value = er.ReadObject<decltype(test)>();
2714 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2714; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2715 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2715); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2715; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2716 });
2717 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2717); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2717; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2718
2719 read = 0;
2720 for (auto er : *aReader) {
2721 static_assert(std::is_same_v<decltype(er), ProfileBufferEntryReader>,
2722 "ProfileChunkedBuffer::Reader range-for should produce "
2723 "ProfileBufferEntryReader objects");
2724 ++read;
2725 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof
(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2725); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2725; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2726 const auto value = er.ReadObject<decltype(test)>();
2727 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2727); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2727; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2728 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2728); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2728; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2729 };
2730 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2730); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2730; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2731 return 5;
2732 });
2733 MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ran)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran"
")"); do { *((volatile int*)__null) = 2733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2734 MOZ_RELEASE_ASSERT(result == 5)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 5)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 5))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 5", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2734); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 5"
")"); do { *((volatile int*)__null) = 2734; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2735
2736 // Read the int directly from the ProfileChunkedBuffer, without block index.
2737 size_t read = 0;
2738 cb.ReadEach([&](ProfileBufferEntryReader& er) {
2739 ++read;
2740 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof
(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2740); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2740; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2741 const auto value = er.ReadObject<decltype(test)>();
2742 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2742; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2743 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2743); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2743; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2744 });
2745 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2746
2747 // Read the int directly from the ProfileChunkedBuffer, with block index.
2748 read = 0;
2749 blockIndex = nullptr;
2750 cb.ReadEach(
2751 [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) {
2752 ++read;
2753 MOZ_RELEASE_ASSERT(!!aBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aBlockIndex))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!!aBlockIndex",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2753); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aBlockIndex"
")"); do { *((volatile int*)__null) = 2753; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2754 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2754); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 2754; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2755 blockIndex = aBlockIndex;
2756 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof
(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2756); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2756; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2757 const auto value = er.ReadObject<decltype(test)>();
2758 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2758); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2758; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2759 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2759; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2760 });
2761 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2761); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2761; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2762 MOZ_RELEASE_ASSERT(!!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!blockIndex))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2762); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!blockIndex"
")"); do { *((volatile int*)__null) = 2762; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2763 MOZ_RELEASE_ASSERT(blockIndex != nullptr)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(blockIndex != nullptr)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(blockIndex != nullptr))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex != nullptr"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2763); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex != nullptr"
")"); do { *((volatile int*)__null) = 2763; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2764
2765 // Read the int from its block index.
2766 read = 0;
2767 result = 0;
2768 result = cb.ReadAt(blockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) {
2769 ++read;
2770 MOZ_RELEASE_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2770); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isSome()"
")"); do { *((volatile int*)__null) = 2770; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2771 MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->CurrentBlockIndex() == blockIndex)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->CurrentBlockIndex() == blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() == blockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2771); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() == blockIndex"
")"); do { *((volatile int*)__null) = 2771; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2772 MOZ_RELEASE_ASSERT(!er->NextBlockIndex())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2772); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex()"
")"); do { *((volatile int*)__null) = 2772; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2773 MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == sizeof(test))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->RemainingBytes() == sizeof(test)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(test)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2773); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2773; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2774 const auto value = er->ReadObject<decltype(test)>();
2775 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2775); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2775; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2776 MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2776); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2776; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2777 return 6;
2778 });
2779 MOZ_RELEASE_ASSERT(result == 6)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 6)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 6))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 6", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2779); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 6"
")"); do { *((volatile int*)__null) = 2779; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2780 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2780); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2780; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2781
2782 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
")"); do { *((volatile int*)__null) = 2782; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2783 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2784; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2784 cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2784; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2785 MOZ_RELEASE_ASSERT(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2785); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1)"
")"); do { *((volatile int*)__null) = 2785; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2786 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2786); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd)"
")"); do { *((volatile int*)__null) = 2786; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2787
2788 // No changes after reads.
2789 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof
(test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2790 cb, 1, 1 + ULEB128Size(sizeof(test)) + sizeof(test), 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof
(test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2791
2792 // Steal the underlying ProfileBufferChunks from the ProfileChunkedBuffer.
2793 chunks = cb.GetAllChunks();
2794 MOZ_RELEASE_ASSERT(!!chunks, "Expected at least one chunk")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunks))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!!chunks" " (" "Expected at least one chunk"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunks"
") (" "Expected at least one chunk" ")"); do { *((volatile int
*)__null) = 2794; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
2795 MOZ_RELEASE_ASSERT(!!chunks->GetNext(), "Expected two chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!chunks->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!chunks->GetNext()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunks->GetNext()"
" (" "Expected two chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunks->GetNext()"
") (" "Expected two chunks" ")"); do { *((volatile int*)__null
) = 2795; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
2796 MOZ_RELEASE_ASSERT(!chunks->GetNext()->GetNext(), "Expected only two chunks")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunks->GetNext()->GetNext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunks->GetNext()->GetNext
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!chunks->GetNext()->GetNext()" " (" "Expected only two chunks"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2796); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks->GetNext()->GetNext()"
") (" "Expected only two chunks" ")"); do { *((volatile int*
)__null) = 2796; __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2797 const ProfileChunkedBuffer::Length chunkActualSize = chunks->BufferBytes();
2798 MOZ_RELEASE_ASSERT(chunkActualSize >= chunkMinSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunkActualSize >= chunkMinSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunkActualSize >= chunkMinSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunkActualSize >= chunkMinSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualSize >= chunkMinSize"
")"); do { *((volatile int*)__null) = 2798; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2799 MOZ_RELEASE_ASSERT(chunks->RangeStart() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunks->RangeStart() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunks->RangeStart() == 1
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunks->RangeStart() == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2799); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->RangeStart() == 1"
")"); do { *((volatile int*)__null) = 2799; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2800 MOZ_RELEASE_ASSERT(chunks->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunks->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(chunks->OffsetFirstBlock(
) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("chunks->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2800); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->OffsetFirstBlock() == 0"
")"); do { *((volatile int*)__null) = 2800; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2801 MOZ_RELEASE_ASSERT(chunks->OffsetPastLastBlock() == 1 + sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(chunks->OffsetPastLastBlock() == 1 + sizeof(test)
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(chunks->OffsetPastLastBlock() == 1 + sizeof(test)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"chunks->OffsetPastLastBlock() == 1 + sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2801); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->OffsetPastLastBlock() == 1 + sizeof(test)"
")"); do { *((volatile int*)__null) = 2801; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2802
2803 // GetAllChunks() should have advanced the index one full chunk forward.
2804 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1 + chunkActualSize,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2805 1 + chunkActualSize, 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2806
2807 // Nothing more to read from the now-empty ProfileChunkedBuffer.
2808 cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2808); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 2808; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
2809 cb.ReadEach([](ProfileBufferEntryReader&, ProfileBufferBlockIndex) {
2810 MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2810); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 2810; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2811 });
2812 result = 0;
2813 result = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) {
2814 MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("er.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2814); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()"
")"); do { *((volatile int*)__null) = 2814; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2815 return 7;
2816 });
2817 MOZ_RELEASE_ASSERT(result == 7)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(result == 7)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(result == 7))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("result == 7", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2817); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 7"
")"); do { *((volatile int*)__null) = 2817; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2818
2819 // Read the int from the stolen chunks.
2820 read = 0;
2821 ProfileChunkedBuffer::ReadEach(
2822 chunks.get(), nullptr,
2823 [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) {
2824 ++read;
2825 MOZ_RELEASE_ASSERT(aBlockIndex == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aBlockIndex == blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aBlockIndex == blockIndex)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aBlockIndex == blockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2825); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex == blockIndex"
")"); do { *((volatile int*)__null) = 2825; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2826 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof
(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)"
")"); do { *((volatile int*)__null) = 2826; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2827 const auto value = er.ReadObject<decltype(test)>();
2828 MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == test)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == test",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test"
")"); do { *((volatile int*)__null) = 2828; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2829 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2829); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2829; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2830 });
2831 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2831); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2831; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2832
2833 // No changes after reads.
2834 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1 + chunkActualSize,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2835 1 + chunkActualSize, 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + chunkActualSize))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2836
2837 // Write lots of numbers (by memcpy), which should trigger Chunk destructions.
2838 ProfileBufferBlockIndex firstBlockIndex;
2839 MOZ_RELEASE_ASSERT(!firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!firstBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!firstBlockIndex))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!firstBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2839); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!firstBlockIndex"
")"); do { *((volatile int*)__null) = 2839; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2840 ProfileBufferBlockIndex lastBlockIndex;
2841 MOZ_RELEASE_ASSERT(!lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!lastBlockIndex))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!lastBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2841); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!lastBlockIndex"
")"); do { *((volatile int*)__null) = 2841; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2842 const size_t lots = 2 * bufferMaxSize / (1 + sizeof(int));
2843 for (size_t i = 1; i < lots; ++i) {
2844 ProfileBufferBlockIndex blockIndex = cb.PutFrom(&i, sizeof(i));
2845 MOZ_RELEASE_ASSERT(!!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!blockIndex))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2845); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!blockIndex"
")"); do { *((volatile int*)__null) = 2845; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2846 MOZ_RELEASE_ASSERT(blockIndex > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(blockIndex > firstBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(blockIndex > firstBlockIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"blockIndex > firstBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2846); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2846; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2847 if (!firstBlockIndex) {
2848 firstBlockIndex = blockIndex;
2849 }
2850 MOZ_RELEASE_ASSERT(blockIndex > lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(blockIndex > lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(blockIndex > lastBlockIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"blockIndex > lastBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2850); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex > lastBlockIndex"
")"); do { *((volatile int*)__null) = 2850; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2851 lastBlockIndex = blockIndex;
2852 }
2853
2854 ProfileChunkedBuffer::State stateAfterPuts = cb.GetState();
2855 ProfileBufferIndex startAfterPuts = stateAfterPuts.mRangeStart;
2856 MOZ_RELEASE_ASSERT(startAfterPuts > 1 + chunkActualSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(startAfterPuts > 1 + chunkActualSize)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(startAfterPuts > 1 + chunkActualSize))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("startAfterPuts > 1 + chunkActualSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2856); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterPuts > 1 + chunkActualSize"
")"); do { *((volatile int*)__null) = 2856; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2857 ProfileBufferIndex endAfterPuts = stateAfterPuts.mRangeEnd;
2858 MOZ_RELEASE_ASSERT(endAfterPuts > startAfterPuts)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(endAfterPuts > startAfterPuts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(endAfterPuts > startAfterPuts
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"endAfterPuts > startAfterPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2858); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterPuts > startAfterPuts"
")"); do { *((volatile int*)__null) = 2858; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2859 uint64_t pushedAfterPuts = stateAfterPuts.mPushedBlockCount;
2860 MOZ_RELEASE_ASSERT(pushedAfterPuts > 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(pushedAfterPuts > 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(pushedAfterPuts > 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("pushedAfterPuts > 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2860); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pushedAfterPuts > 0"
")"); do { *((volatile int*)__null) = 2860; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2861 uint64_t clearedAfterPuts = stateAfterPuts.mClearedBlockCount;
2862 MOZ_RELEASE_ASSERT(clearedAfterPuts > 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(clearedAfterPuts > 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(clearedAfterPuts > 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("clearedAfterPuts > 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2862); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "clearedAfterPuts > 0"
")"); do { *((volatile int*)__null) = 2862; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2863 MOZ_RELEASE_ASSERT(stateAfterPuts.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterPuts.mFailedPutBytes == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(stateAfterPuts.mFailedPutBytes
== 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("stateAfterPuts.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2863); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterPuts.mFailedPutBytes == 0"
")"); do { *((volatile int*)__null) = 2863; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2864 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2864); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
")"); do { *((volatile int*)__null) = 2864; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2865 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2866); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2866; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2866 !cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2866); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2866; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2867 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2868); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2868; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2868 !cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2868); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2868; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2869
2870 // Read extant numbers, which should at least follow each other.
2871 read = 0;
2872 size_t i = 0;
2873 cb.ReadEach(
2874 [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) {
2875 ++read;
2876 MOZ_RELEASE_ASSERT(!!aBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!aBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!aBlockIndex))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!!aBlockIndex",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2876); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aBlockIndex"
")"); do { *((volatile int*)__null) = 2876; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2877 MOZ_RELEASE_ASSERT(aBlockIndex > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aBlockIndex > firstBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aBlockIndex > firstBlockIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aBlockIndex > firstBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2877); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2877; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2878 MOZ_RELEASE_ASSERT(aBlockIndex <= lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aBlockIndex <= lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aBlockIndex <= lastBlockIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aBlockIndex <= lastBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2878); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex <= lastBlockIndex"
")"); do { *((volatile int*)__null) = 2878; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2879 MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == sizeof(size_t))>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(er.RemainingBytes() == sizeof(size_t)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("er.RemainingBytes() == sizeof(size_t)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2879); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(size_t)"
")"); do { *((volatile int*)__null) = 2879; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2880 const auto value = er.ReadObject<size_t>();
2881 if (i == 0) {
2882 i = value;
2883 } else {
2884 MOZ_RELEASE_ASSERT(value == ++i)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == ++i)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == ++i))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == ++i", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2884); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == ++i"
")"); do { *((volatile int*)__null) = 2884; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2885 }
2886 MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2886); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2886; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2887 });
2888 MOZ_RELEASE_ASSERT(read != 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read != 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read != 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read != 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2888); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read != 0"
")"); do { *((volatile int*)__null) = 2888; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2889 MOZ_RELEASE_ASSERT(read < lots)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read < lots)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read < lots))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("read < lots"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2889); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read < lots"
")"); do { *((volatile int*)__null) = 2889; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2890
2891 // Read first extant number.
2892 read = 0;
2893 i = 0;
2894 blockIndex = nullptr;
2895 success =
2896 cb.ReadAt(firstBlockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) {
2897 MOZ_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2897); AnnotateMozCrashReason("MOZ_ASSERT" "(" "er.isSome()"
")"); do { *((volatile int*)__null) = 2897; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2898 ++read;
2899 MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->CurrentBlockIndex() > firstBlockIndex)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(er->CurrentBlockIndex() > firstBlockIndex))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() > firstBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2899); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2899; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2900 MOZ_RELEASE_ASSERT(!!er->NextBlockIndex())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!!er->NextBlockIndex())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!!er->NextBlockIndex())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!er->NextBlockIndex()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!er->NextBlockIndex()"
")"); do { *((volatile int*)__null) = 2900; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2901 MOZ_RELEASE_ASSERT(er->NextBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() > firstBlockIndex)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->NextBlockIndex() > firstBlockIndex))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() > firstBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2901); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2901; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2902 MOZ_RELEASE_ASSERT(er->NextBlockIndex() < lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() < lastBlockIndex)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->NextBlockIndex() < lastBlockIndex))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() < lastBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2902); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() < lastBlockIndex"
")"); do { *((volatile int*)__null) = 2902; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2903 blockIndex = er->NextBlockIndex();
2904 MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == sizeof(size_t))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->RemainingBytes() == sizeof(size_t)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(size_t)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2904); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(size_t)"
")"); do { *((volatile int*)__null) = 2904; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2905 const auto value = er->ReadObject<size_t>();
2906 MOZ_RELEASE_ASSERT(i == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i == 0)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(i == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("i == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2906); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i == 0"
")"); do { *((volatile int*)__null) = 2906; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2907 i = value;
2908 MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2908); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2908; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2909 return 7;
2910 });
2911 MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2911); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success"
")"); do { *((volatile int*)__null) = 2911; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2912 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2912); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 2912; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2913 // Read other extant numbers one by one.
2914 do {
2915 bool success =
2916 cb.ReadAt(blockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) {
2917 MOZ_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2917); AnnotateMozCrashReason("MOZ_ASSERT" "(" "er.isSome()"
")"); do { *((volatile int*)__null) = 2917; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2918 ++read;
2919 MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->CurrentBlockIndex() == blockIndex)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->CurrentBlockIndex() == blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() == blockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() == blockIndex"
")"); do { *((volatile int*)__null) = 2919; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2920 MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() >
blockIndex)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er->
NextBlockIndex() > blockIndex))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2921); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex"
")"); do { *((volatile int*)__null) = 2921; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2921 er->NextBlockIndex() > blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() >
blockIndex)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er->
NextBlockIndex() > blockIndex))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2921); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex"
")"); do { *((volatile int*)__null) = 2921; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2922 MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() >
firstBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er
->NextBlockIndex() > firstBlockIndex))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2923; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2923 er->NextBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() >
firstBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er
->NextBlockIndex() > firstBlockIndex))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex"
")"); do { *((volatile int*)__null) = 2923; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2924 MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() <=
lastBlockIndex)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er
->NextBlockIndex() <= lastBlockIndex))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2925); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex"
")"); do { *((volatile int*)__null) = 2925; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2925 er->NextBlockIndex() <= lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!er->NextBlockIndex() || er->NextBlockIndex() <=
lastBlockIndex)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er
->NextBlockIndex() <= lastBlockIndex))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2925); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex"
")"); do { *((volatile int*)__null) = 2925; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2926 MOZ_RELEASE_ASSERT(er->NextBlockIndex()do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex
: blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex
< lastBlockIndex : blockIndex == lastBlockIndex))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
" (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2927 ? blockIndex < lastBlockIndexdo { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex
: blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex
< lastBlockIndex : blockIndex == lastBlockIndex))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
" (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2928 : blockIndex == lastBlockIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex
: blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex
< lastBlockIndex : blockIndex == lastBlockIndex))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
" (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2929 "er->NextBlockIndex() should only be null when "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex
: blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex
< lastBlockIndex : blockIndex == lastBlockIndex))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
" (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2930 "blockIndex is at the last block")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex
: blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex
< lastBlockIndex : blockIndex == lastBlockIndex))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
" (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex"
") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block"
")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2931 blockIndex = er->NextBlockIndex();
2932 MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == sizeof(size_t))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(er->RemainingBytes() == sizeof(size_t)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(size_t)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2932); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(size_t)"
")"); do { *((volatile int*)__null) = 2932; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2933 const auto value = er->ReadObject<size_t>();
2934 MOZ_RELEASE_ASSERT(value == ++i)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(value == ++i)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(value == ++i))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("value == ++i", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2934); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == ++i"
")"); do { *((volatile int*)__null) = 2934; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2935 MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0"
")"); do { *((volatile int*)__null) = 2935; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2936 return true;
2937 });
2938 MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2938); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success"
")"); do { *((volatile int*)__null) = 2938; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2939 } while (blockIndex);
2940 MOZ_RELEASE_ASSERT(read > 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read > 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read > 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("read > 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2940); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read > 1"
")"); do { *((volatile int*)__null) = 2940; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2941
2942 // No changes after reads.
2943 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterPuts
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterPuts
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (pushedAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
pushedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (pushedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (pushedAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (clearedAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (
clearedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mClearedBlockCount == (clearedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (clearedAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
2944 cb, startAfterPuts, endAfterPuts, pushedAfterPuts, clearedAfterPuts, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterPuts
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterPuts
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (pushedAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
pushedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (pushedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (pushedAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (clearedAfterPuts))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (
clearedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mClearedBlockCount == (clearedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (clearedAfterPuts)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
2945
2946# ifdef DEBUG1
2947 // cb.Dump();
2948# endif
2949
2950 cb.Clear();
2951
2952# ifdef DEBUG1
2953 // cb.Dump();
2954# endif
2955
2956 ProfileChunkedBuffer::State stateAfterClear = cb.GetState();
2957 ProfileBufferIndex startAfterClear = stateAfterClear.mRangeStart;
2958 MOZ_RELEASE_ASSERT(startAfterClear > startAfterPuts)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(startAfterClear > startAfterPuts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(startAfterClear > startAfterPuts
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"startAfterClear > startAfterPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2958); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterClear > startAfterPuts"
")"); do { *((volatile int*)__null) = 2958; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2959 ProfileBufferIndex endAfterClear = stateAfterClear.mRangeEnd;
2960 MOZ_RELEASE_ASSERT(endAfterClear == startAfterClear)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(endAfterClear == startAfterClear)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(endAfterClear == startAfterClear
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"endAfterClear == startAfterClear", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2960); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterClear == startAfterClear"
")"); do { *((volatile int*)__null) = 2960; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2961 MOZ_RELEASE_ASSERT(stateAfterClear.mPushedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterClear.mPushedBlockCount == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterClear.mPushedBlockCount == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("stateAfterClear.mPushedBlockCount == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2961); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mPushedBlockCount == 0"
")"); do { *((volatile int*)__null) = 2961; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2962 MOZ_RELEASE_ASSERT(stateAfterClear.mClearedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterClear.mClearedBlockCount == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterClear.mClearedBlockCount == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("stateAfterClear.mClearedBlockCount == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2962); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mClearedBlockCount == 0"
")"); do { *((volatile int*)__null) = 2962; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2963 MOZ_RELEASE_ASSERT(stateAfterClear.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterClear.mFailedPutBytes == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(stateAfterClear.mFailedPutBytes
== 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("stateAfterClear.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2963); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mFailedPutBytes == 0"
")"); do { *((volatile int*)__null) = 2963; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2964 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2964); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})"
")"); do { *((volatile int*)__null) = 2964; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2965 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2966); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2966; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2966 !cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
()))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex
())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2966); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())"
")"); do { *((volatile int*)__null) = 2966; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2967 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd -
1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd -
1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1)"
")"); do { *((volatile int*)__null) = 2967; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2968 MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2968); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)"
")"); do { *((volatile int*)__null) = 2968; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2969
2970 // Start writer threads.
2971 constexpr int ThreadCount = 32;
2972 std::thread threads[ThreadCount];
2973 for (int threadNo = 0; threadNo < ThreadCount; ++threadNo) {
2974 threads[threadNo] = std::thread(
2975 [&](int aThreadNo) {
2976 ::SleepMilli(1);
2977 constexpr int pushCount = 1024;
2978 for (int push = 0; push < pushCount; ++push) {
2979 // Reserve as many bytes as the thread number (but at least enough
2980 // to store an int), and write an increasing int.
2981 const bool success =
2982 cb.Put(std::max(aThreadNo, int(sizeof(push))),
2983 [&](Maybe<ProfileBufferEntryWriter>& aEW) {
2984 if (!aEW) {
2985 return false;
2986 }
2987 aEW->WriteObject(aThreadNo * 1000000 + push);
2988 // Advance writer to the end.
2989 for (size_t r = aEW->RemainingBytes(); r != 0; --r) {
2990 aEW->WriteObject<char>('_');
2991 }
2992 return true;
2993 });
2994 MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 2994); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success"
")"); do { *((volatile int*)__null) = 2994; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2995 }
2996 },
2997 threadNo);
2998 }
2999
3000 // Wait for all writer threads to die.
3001 for (auto&& thread : threads) {
3002 thread.join();
3003 }
3004
3005# ifdef DEBUG1
3006 // cb.Dump();
3007# endif
3008
3009 ProfileChunkedBuffer::State stateAfterMTPuts = cb.GetState();
3010 ProfileBufferIndex startAfterMTPuts = stateAfterMTPuts.mRangeStart;
3011 MOZ_RELEASE_ASSERT(startAfterMTPuts > startAfterClear)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(startAfterMTPuts > startAfterClear)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(startAfterMTPuts > startAfterClear))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("startAfterMTPuts > startAfterClear"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3011); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterMTPuts > startAfterClear"
")"); do { *((volatile int*)__null) = 3011; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3012 ProfileBufferIndex endAfterMTPuts = stateAfterMTPuts.mRangeEnd;
3013 MOZ_RELEASE_ASSERT(endAfterMTPuts > startAfterMTPuts)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(endAfterMTPuts > startAfterMTPuts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(endAfterMTPuts > startAfterMTPuts
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"endAfterMTPuts > startAfterMTPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3013); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterMTPuts > startAfterMTPuts"
")"); do { *((volatile int*)__null) = 3013; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3014 MOZ_RELEASE_ASSERT(stateAfterMTPuts.mPushedBlockCount > 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterMTPuts.mPushedBlockCount > 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterMTPuts.mPushedBlockCount > 0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mPushedBlockCount > 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3014); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mPushedBlockCount > 0"
")"); do { *((volatile int*)__null) = 3014; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3015 MOZ_RELEASE_ASSERT(stateAfterMTPuts.mClearedBlockCount > 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterMTPuts.mClearedBlockCount > 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterMTPuts.mClearedBlockCount > 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mClearedBlockCount > 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mClearedBlockCount > 0"
")"); do { *((volatile int*)__null) = 3015; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3016 MOZ_RELEASE_ASSERT(stateAfterMTPuts.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterMTPuts.mFailedPutBytes == 0)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(stateAfterMTPuts.mFailedPutBytes == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mFailedPutBytes == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3016); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mFailedPutBytes == 0"
")"); do { *((volatile int*)__null) = 3016; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3017
3018 // Reset to out-of-session.
3019 cb.ResetChunkManager();
3020
3021 ProfileChunkedBuffer::State stateAfterReset = cb.GetState();
3022 ProfileBufferIndex startAfterReset = stateAfterReset.mRangeStart;
3023 MOZ_RELEASE_ASSERT(startAfterReset == endAfterMTPuts)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(startAfterReset == endAfterMTPuts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(startAfterReset == endAfterMTPuts
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"startAfterReset == endAfterMTPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterReset == endAfterMTPuts"
")"); do { *((volatile int*)__null) = 3023; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3024 ProfileBufferIndex endAfterReset = stateAfterReset.mRangeEnd;
3025 MOZ_RELEASE_ASSERT(endAfterReset == startAfterReset)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(endAfterReset == startAfterReset)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(endAfterReset == startAfterReset
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"endAfterReset == startAfterReset", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterReset == startAfterReset"
")"); do { *((volatile int*)__null) = 3025; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3026 MOZ_RELEASE_ASSERT(stateAfterReset.mPushedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterReset.mPushedBlockCount == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterReset.mPushedBlockCount == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("stateAfterReset.mPushedBlockCount == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mPushedBlockCount == 0"
")"); do { *((volatile int*)__null) = 3026; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3027 MOZ_RELEASE_ASSERT(stateAfterReset.mClearedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterReset.mClearedBlockCount == 0)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(stateAfterReset.mClearedBlockCount == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("stateAfterReset.mClearedBlockCount == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3027); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mClearedBlockCount == 0"
")"); do { *((volatile int*)__null) = 3027; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3028 MOZ_RELEASE_ASSERT(stateAfterReset.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stateAfterReset.mFailedPutBytes == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(stateAfterReset.mFailedPutBytes
== 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("stateAfterReset.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3028); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mFailedPutBytes == 0"
")"); do { *((volatile int*)__null) = 3028; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3029
3030 success = cb.ReserveAndPut(
3031 []() {
3032 MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3032); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 3032; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3033 return 1;
3034 },
3035 [](Maybe<ProfileBufferEntryWriter>& aEW) { return !!aEW; });
3036 MOZ_RELEASE_ASSERT(!success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3036); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!success"
")"); do { *((volatile int*)__null) = 3036; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3037 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3038 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3039
3040 success =
3041 cb.Put(1, [](Maybe<ProfileBufferEntryWriter>& aEW) { return !!aEW; });
3042 MOZ_RELEASE_ASSERT(!success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!success"
")"); do { *((volatile int*)__null) = 3042; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3043 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3044 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3045
3046 blockIndex = cb.PutFrom(&success, 1);
3047 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 3047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3048 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3049 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3050
3051 blockIndex = cb.PutObjects(123, success, "hello");
3052 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 3052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3053 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3054 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3055
3056 blockIndex = cb.PutObject(123);
3057 MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!blockIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex"
")"); do { *((volatile int*)__null) = 3057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3058 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3059 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3060
3061 chunks = cb.GetAllChunks();
3062 MOZ_RELEASE_ASSERT(!chunks, "Expected no chunks when out-of-session")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!chunks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!chunks))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!chunks" " (" "Expected no chunks when out-of-session"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks"
") (" "Expected no chunks when out-of-session" ")"); do { *(
(volatile int*)__null) = 3062; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3063 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3064 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3065
3066 cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 3066; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
3067 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3068 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3069
3070 success = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) {
3071 MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(er.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("er.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3071); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()"
")"); do { *((volatile int*)__null) = 3071; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3072 return true;
3073 });
3074 MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(success)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success"
")"); do { *((volatile int*)__null) = 3074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3075 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3076 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart
== (startAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (endAfterReset))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3077
3078 printf("TestChunkedBuffer done\n");
3079}
3080
3081static void TestChunkedBufferSingle() {
3082 printf("TestChunkedBufferSingle...\n");
3083
3084 constexpr ProfileChunkedBuffer::Length chunkMinSize = 128;
3085
3086 // Create a ProfileChunkedBuffer that will own&use a
3087 // ProfileBufferChunkManagerSingle, which will give away one
3088 // ProfileBufferChunk that can contain 128 bytes.
3089 ProfileChunkedBuffer cbSingle(
3090 ProfileChunkedBuffer::ThreadSafety::WithoutMutex,
3091 MakeUnique<ProfileBufferChunkManagerSingle>(chunkMinSize));
3092
3093 MOZ_RELEASE_ASSERT(cbSingle.BufferLength().isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cbSingle.BufferLength().isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cbSingle.BufferLength().isSome
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cbSingle.BufferLength().isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3093); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cbSingle.BufferLength().isSome()"
")"); do { *((volatile int*)__null) = 3093; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3094 const ProfileChunkedBuffer::Length bufferBytes = *cbSingle.BufferLength();
3095 MOZ_RELEASE_ASSERT(bufferBytes >= chunkMinSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bufferBytes >= chunkMinSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bufferBytes >= chunkMinSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"bufferBytes >= chunkMinSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3095); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bufferBytes >= chunkMinSize"
")"); do { *((volatile int*)__null) = 3095; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3096
3097 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3098
3099 // We will write this many blocks to fill the chunk.
3100 constexpr size_t testBlocks = 4;
3101 const ProfileChunkedBuffer::Length blockBytes = bufferBytes / testBlocks;
3102 MOZ_RELEASE_ASSERT(ULEB128Size(blockBytes) == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
3103 "This test assumes block sizes are small enough so that "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
3104 "their ULEB128-encoded size is 1 byte")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
3105 const ProfileChunkedBuffer::Length entryBytes =
3106 blockBytes - ULEB128Size(blockBytes);
3107
3108 // First buffer-filling test: Try to write a too-big entry at the end of the
3109 // chunk.
3110
3111 // Write all but one block.
3112 for (size_t i = 0; i < testBlocks - 1; ++i) {
3113 cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3114 MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3114); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()"
")"); do { *((volatile int*)__null) = 3114; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3115 while (aEW->RemainingBytes() > 0) {
3116 **aEW = '0' + i;
3117 ++(*aEW);
3118 }
3119 });
3120 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (i + 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (i + 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (i + 1))"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (i + 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3121 cbSingle, 1, 1 + blockBytes * (i + 1), i + 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (i + 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (i + 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (i + 1))"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (i + 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3122 }
3123
3124 // Write the last block so that it's too big (by 1 byte) to fit in the chunk,
3125 // this should fail.
3126 const ProfileChunkedBuffer::Length remainingBytesForLastBlock =
3127 bufferBytes - blockBytes * (testBlocks - 1);
3128 MOZ_RELEASE_ASSERT(ULEB128Size(remainingBytesForLastBlock) == 1,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1"
" (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
3129 "This test assumes block sizes are small enough so that "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1"
" (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
3130 "their ULEB128-encoded size is 1 byte")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1"
" (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1"
") (" "This test assumes block sizes are small enough so that "
"their ULEB128-encoded size is 1 byte" ")"); do { *((volatile
int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
3131 const ProfileChunkedBuffer::Length entryToFitRemainingBytes =
3132 remainingBytesForLastBlock - ULEB128Size(remainingBytesForLastBlock);
3133 cbSingle.Put(entryToFitRemainingBytes + 1,
3134 [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3135 MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()"
")"); do { *((volatile int*)__null) = 3135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3136 });
3137 // The buffer state should not have changed, apart from the failed bytes.
3138 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3139 cbSingle, 1, 1 + blockBytes * (testBlocks - 1), testBlocks - 1, 0,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3140 remainingBytesForLastBlock + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)"
")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3141
3142 size_t read = 0;
3143 cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) {
3144 MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes"
")"); do { *((volatile int*)__null) = 3144; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3145 while (aER.RemainingBytes() > 0) {
3146 MOZ_RELEASE_ASSERT(*aER == '0' + read)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*aER == '0' + read)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*aER == '0' + read))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("*aER == '0' + read"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == '0' + read"
")"); do { *((volatile int*)__null) = 3146; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3147 ++aER;
3148 }
3149 ++read;
3150 });
3151 MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3151); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1"
")"); do { *((volatile int*)__null) = 3151; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3152
3153 // ~Interlude~ Test AppendContent:
3154 // Create another ProfileChunkedBuffer that will use a
3155 // ProfileBufferChunkManagerWithLocalLimit, which will give away
3156 // ProfileBufferChunks that can contain 128 bytes, using up to 1KB of memory
3157 // (including usable 128 bytes and headers).
3158 constexpr size_t bufferMaxSize = 1024;
3159 ProfileBufferChunkManagerWithLocalLimit cmTarget(bufferMaxSize, chunkMinSize);
3160 ProfileChunkedBuffer cbTarget(ProfileChunkedBuffer::ThreadSafety::WithMutex,
3161 cmTarget);
3162
3163 // It should start empty.
3164 cbTarget.ReadEach(
3165 [](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3165); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 3165; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
3166 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbTarget, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)"
")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3167
3168 // Copy the contents from cbSingle to cbTarget.
3169 cbTarget.AppendContents(cbSingle);
3170
3171 // And verify that we now have the same contents in cbTarget.
3172 read = 0;
3173 cbTarget.ReadEach([&](ProfileBufferEntryReader& aER) {
3174 MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3174); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes"
")"); do { *((volatile int*)__null) = 3174; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3175 while (aER.RemainingBytes() > 0) {
3176 MOZ_RELEASE_ASSERT(*aER == '0' + read)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*aER == '0' + read)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*aER == '0' + read))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("*aER == '0' + read"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3176); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == '0' + read"
")"); do { *((volatile int*)__null) = 3176; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3177 ++aER;
3178 }
3179 ++read;
3180 });
3181 MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3181); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1"
")"); do { *((volatile int*)__null) = 3181; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3182 // The state should be the same as the source.
3183 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3184 cbTarget, 1, 1 + blockBytes * (testBlocks - 1), testBlocks - 1, 0, 0){ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3185
3186# ifdef DEBUG1
3187 // cbSingle.Dump();
3188 // cbTarget.Dump();
3189# endif
3190
3191 // Because we failed to write a too-big chunk above, the chunk was marked
3192 // full, so that entries should be consistently rejected from now on.
3193 cbSingle.Put(1, [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3194 MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3194); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()"
")"); do { *((volatile int*)__null) = 3194; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3195 });
3196 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3197 cbSingle, 1, 1 + blockBytes * ((testBlocks - 1)), testBlocks - 1, 0,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3198 remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes
* ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock
+ 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3199
3200 // Clear the buffer before the next test.
3201
3202 cbSingle.Clear();
3203 // Clear() should move the index to the next chunk range -- even if it's
3204 // really reusing the same chunk.
3205 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1 + bufferBytes,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3206 1 + bufferBytes, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3207 cbSingle.ReadEach(
3208 [&](ProfileBufferEntryReader& aER) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3208); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 3208; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
3209
3210 // Second buffer-filling test: Try to write a final entry that just fits at
3211 // the end of the chunk.
3212
3213 // Write all but one block.
3214 for (size_t i = 0; i < testBlocks - 1; ++i) {
3215 cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3216 MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3216); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()"
")"); do { *((volatile int*)__null) = 3216; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3217 while (aEW->RemainingBytes() > 0) {
3218 **aEW = 'a' + i;
3219 ++(*aEW);
3220 }
3221 });
3222 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
+ blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (i + 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3223 cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * (i + 1),{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
+ blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (i + 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3224 i + 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
+ blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (i + 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3225 }
3226
3227 read = 0;
3228 cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) {
3229 MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3229); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes"
")"); do { *((volatile int*)__null) = 3229; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3230 while (aER.RemainingBytes() > 0) {
3231 MOZ_RELEASE_ASSERT(*aER == 'a' + read)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*aER == 'a' + read)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*aER == 'a' + read))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("*aER == 'a' + read"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3231); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'a' + read"
")"); do { *((volatile int*)__null) = 3231; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3232 ++aER;
3233 }
3234 ++read;
3235 });
3236 MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3236); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1"
")"); do { *((volatile int*)__null) = 3236; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3237
3238 // Write the last block so that it fits exactly in the chunk.
3239 cbSingle.Put(entryToFitRemainingBytes,
3240 [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3241 MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3241); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()"
")"); do { *((volatile int*)__null) = 3241; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3242 while (aEW->RemainingBytes() > 0) {
3243 **aEW = 'a' + (testBlocks - 1);
3244 ++(*aEW);
3245 }
3246 });
3247 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3248 cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * testBlocks,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3249 testBlocks, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3250
3251 read = 0;
3252 cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) {
3253 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes
: entryToFitRemainingBytes))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read
< testBlocks) ? entryBytes : entryToFitRemainingBytes))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3254 aER.RemainingBytes() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes
: entryToFitRemainingBytes))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read
< testBlocks) ? entryBytes : entryToFitRemainingBytes))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3255 ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes
: entryToFitRemainingBytes))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read
< testBlocks) ? entryBytes : entryToFitRemainingBytes))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)"
")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3256 while (aER.RemainingBytes() > 0) {
3257 MOZ_RELEASE_ASSERT(*aER == 'a' + read)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*aER == 'a' + read)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*aER == 'a' + read))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("*aER == 'a' + read"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3257); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'a' + read"
")"); do { *((volatile int*)__null) = 3257; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3258 ++aER;
3259 }
3260 ++read;
3261 });
3262 MOZ_RELEASE_ASSERT(read == testBlocks)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == testBlocks)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == testBlocks))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3262); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks"
")"); do { *((volatile int*)__null) = 3262; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3263
3264 // Because the single chunk has been filled, it shouldn't be possible to write
3265 // more entries.
3266 cbSingle.Put(1, [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3267 MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isNothing())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3267); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()"
")"); do { *((volatile int*)__null) = 3267; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3268 });
3269 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size
(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3270 cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * testBlocks,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size
(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3271 testBlocks, 0, ULEB128Size(1u) + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes + blockBytes * testBlocks))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (testBlocks))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (
testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size
(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)"
")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3272
3273 cbSingle.Clear();
3274 // Clear() should move the index to the next chunk range -- even if it's
3275 // really reusing the same chunk.
3276 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1 + bufferBytes * 2,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes * 2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
* 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes * 2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3277 1 + bufferBytes * 2, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes * 2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes
* 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes * 2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3278 cbSingle.ReadEach(
3279 [&](ProfileBufferEntryReader& aER) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
")"); do { *((volatile int*)__null) = 3279; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; });
3280
3281 // Clear() recycles the released chunk, so we should be able to record new
3282 // entries.
3283 cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) {
3284 MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aEW.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3284); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()"
")"); do { *((volatile int*)__null) = 3284; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3285 while (aEW->RemainingBytes() > 0) {
3286 **aEW = 'x';
3287 ++(*aEW);
3288 }
3289 });
3290 VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size
(entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3291 cbSingle, 1 + bufferBytes * 2,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size
(entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
3292 1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes, 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd
== (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size
(entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount
== (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes
== (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)"
")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); }
;
3293 read = 0;
3294 cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) {
3295 MOZ_RELEASE_ASSERT(read == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3295); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 0"
")"); do { *((volatile int*)__null) = 3295; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3296 MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3296); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes"
")"); do { *((volatile int*)__null) = 3296; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3297 while (aER.RemainingBytes() > 0) {
3298 MOZ_RELEASE_ASSERT(*aER == 'x')do { static_assert( mozilla::detail::AssertionConditionType<
decltype(*aER == 'x')>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(*aER == 'x'))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("*aER == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'x'"
")"); do { *((volatile int*)__null) = 3298; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3299 ++aER;
3300 }
3301 ++read;
3302 });
3303 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3303); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 3303; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3304
3305 printf("TestChunkedBufferSingle done\n");
3306}
3307
3308static void TestModuloBuffer(ModuloBuffer<>& mb, uint32_t MBSize) {
3309 using MB = ModuloBuffer<>;
3310
3311 MOZ_RELEASE_ASSERT(mb.BufferLength().Value() == MBSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.BufferLength().Value() == MBSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.BufferLength().Value() ==
MBSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.BufferLength().Value() == MBSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3311); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.BufferLength().Value() == MBSize"
")"); do { *((volatile int*)__null) = 3311; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3312
3313 // Iterator comparisons.
3314 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) == mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) == mb.ReaderAt(2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) == mb.ReaderAt
(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) == mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) == mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3314; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3315 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) != mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) != mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) != mb.ReaderAt
(3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) != mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3315); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) != mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3315; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3316 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) < mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) < mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) < mb.ReaderAt
(3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) < mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) < mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3316; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3317 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) <= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) <= mb.ReaderAt(2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) <= mb.ReaderAt
(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) <= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3317); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) <= mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3317; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3318 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) <= mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) <= mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) <= mb.ReaderAt
(3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) <= mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) <= mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3318; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3319 MOZ_RELEASE_ASSERT(mb.ReaderAt(3) > mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(3) > mb.ReaderAt(2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) > mb.ReaderAt
(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(3) > mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3319); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) > mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3319; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3320 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) >= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) >= mb.ReaderAt(2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) >= mb.ReaderAt
(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(2) >= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3320); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) >= mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3320; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3321 MOZ_RELEASE_ASSERT(mb.ReaderAt(3) >= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(3) >= mb.ReaderAt(2))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) >= mb.ReaderAt
(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(3) >= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3321); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) >= mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3321; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3322
3323 // Iterators indices don't wrap around (even though they may be pointing at
3324 // the same location).
3325 MOZ_RELEASE_ASSERT(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3325); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)"
")"); do { *((volatile int*)__null) = 3325; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3326 MOZ_RELEASE_ASSERT(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3326); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)"
")"); do { *((volatile int*)__null) = 3326; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3327
3328 // Dereference.
3329 static_assert(std::is_same<decltype(*mb.ReaderAt(0)), const MB::Byte&>::value,
3330 "Dereferencing from a reader should return const Byte*");
3331 static_assert(std::is_same<decltype(*mb.WriterAt(0)), MB::Byte&>::value,
3332 "Dereferencing from a writer should return Byte*");
3333 // Contiguous between 0 and MBSize-1.
3334 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize - 1) ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0
) + (MBSize - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize - 1
) == &*mb.ReaderAt(0) + (MBSize - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3335); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)"
")"); do { *((volatile int*)__null) = 3335; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3335 &*mb.ReaderAt(0) + (MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0
) + (MBSize - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize - 1
) == &*mb.ReaderAt(0) + (MBSize - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3335); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)"
")"); do { *((volatile int*)__null) = 3335; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3336 // Wraps around.
3337 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3337); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3337; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3338 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize + MBSize - 1) ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt
(MBSize - 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize + MBSize
- 1) == &*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3339); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)"
")"); do { *((volatile int*)__null) = 3339; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3339 &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt
(MBSize - 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize + MBSize
- 1) == &*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3339); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)"
")"); do { *((volatile int*)__null) = 3339; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3340 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt
(0))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt
(0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3340); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3340; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3341 // Power of 2 modulo wrapping.
3342 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt
(MBSize - 1))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&*mb.ReaderAt(uint32_t(-1)) ==
&*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3342); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1)"
")"); do { *((volatile int*)__null) = 3342; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3343 MOZ_RELEASE_ASSERT(&*mb.ReaderAt(static_cast<MB::Index>(-1)) ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(static_cast<MB::Index>(-1)) ==
&*mb.ReaderAt(MBSize - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(static_cast
<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3344); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)"
")"); do { *((volatile int*)__null) = 3344; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3344 &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&*mb.ReaderAt(static_cast<MB::Index>(-1)) ==
&*mb.ReaderAt(MBSize - 1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(static_cast
<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3344); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)"
")"); do { *((volatile int*)__null) = 3344; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3345
3346 // Arithmetic.
3347 MB::Reader arit = mb.ReaderAt(0);
3348 MOZ_RELEASE_ASSERT(++arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(++arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(++arit == mb.ReaderAt(1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("++arit == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3348); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "++arit == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3348; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3349 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3349); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3349; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3350
3351 MOZ_RELEASE_ASSERT(--arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(--arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(--arit == mb.ReaderAt(0)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("--arit == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3351); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "--arit == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3351; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3352 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3352; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3353
3354 MOZ_RELEASE_ASSERT(arit++ == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit++ == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit++ == mb.ReaderAt(0)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("arit++ == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3354); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit++ == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3354; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3355 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3355); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3355; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3356
3357 MOZ_RELEASE_ASSERT(arit-- == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit-- == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit-- == mb.ReaderAt(1)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("arit-- == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3357); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit-- == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3357; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3358 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3358); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3358; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3359
3360 MOZ_RELEASE_ASSERT(arit + 3 == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit + 3 == mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit + 3 == mb.ReaderAt(3)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arit + 3 == mb.ReaderAt(3)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3360); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit + 3 == mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3360; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3361 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3361); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3361; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3362
3363 MOZ_RELEASE_ASSERT(4 + arit == mb.ReaderAt(4))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(4 + arit == mb.ReaderAt(4))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(4 + arit == mb.ReaderAt(4)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("4 + arit == mb.ReaderAt(4)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "4 + arit == mb.ReaderAt(4)"
")"); do { *((volatile int*)__null) = 3363; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3364 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3364); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)"
")"); do { *((volatile int*)__null) = 3364; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3365
3366 // (Can't have assignments inside asserts, hence the split.)
3367 const bool checkPlusEq = ((arit += 3) == mb.ReaderAt(3));
3368 MOZ_RELEASE_ASSERT(checkPlusEq)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(checkPlusEq)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(checkPlusEq))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("checkPlusEq", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3368); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "checkPlusEq"
")"); do { *((volatile int*)__null) = 3368; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3369 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(3)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(3)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3369); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3369; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3370
3371 MOZ_RELEASE_ASSERT((arit - 2) == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((arit - 2) == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((arit - 2) == mb.ReaderAt(1)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"(arit - 2) == mb.ReaderAt(1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3371); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(arit - 2) == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3371; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3372 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(3)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(3)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3372); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(3)"
")"); do { *((volatile int*)__null) = 3372; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3373
3374 const bool checkMinusEq = ((arit -= 2) == mb.ReaderAt(1));
3375 MOZ_RELEASE_ASSERT(checkMinusEq)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(checkMinusEq)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(checkMinusEq))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("checkMinusEq", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3375); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "checkMinusEq"
")"); do { *((volatile int*)__null) = 3375; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3376 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3376); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3376; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3377
3378 // Random access.
3379 MOZ_RELEASE_ASSERT(&arit[3] == &*(arit + 3))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&arit[3] == &*(arit + 3))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(&arit[3] == &*(arit +
3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("&arit[3] == &*(arit + 3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3379); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&arit[3] == &*(arit + 3)"
")"); do { *((volatile int*)__null) = 3379; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3380 MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3380); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)"
")"); do { *((volatile int*)__null) = 3380; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3381
3382 // Iterator difference.
3383 MOZ_RELEASE_ASSERT(mb.ReaderAt(3) - mb.ReaderAt(1) == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(3) - mb.ReaderAt(1) == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) - mb.ReaderAt
(1) == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mb.ReaderAt(3) - mb.ReaderAt(1) == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3383); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) - mb.ReaderAt(1) == 2"
")"); do { *((volatile int*)__null) = 3383; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3384 MOZ_RELEASE_ASSERT(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3384); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)"
")"); do { *((volatile int*)__null) = 3384; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3385
3386 // Only testing Writer, as Reader is just a subset with no code differences.
3387 MB::Writer it = mb.WriterAt(0);
3388 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3388); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 0"
")"); do { *((volatile int*)__null) = 3388; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3389
3390 // Write two characters at the start.
3391 it.WriteObject('x');
3392 it.WriteObject('y');
3393
3394 // Backtrack to read them.
3395 it -= 2;
3396 // PeekObject should read without moving.
3397 MOZ_RELEASE_ASSERT(it.PeekObject<char>() == 'x')do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.PeekObject<char>() == 'x')>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.PeekObject<char>() ==
'x'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.PeekObject<char>() == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3397); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.PeekObject<char>() == 'x'"
")"); do { *((volatile int*)__null) = 3397; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3398 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3398); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 0"
")"); do { *((volatile int*)__null) = 3398; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3399 // ReadObject should read and move past the character.
3400 MOZ_RELEASE_ASSERT(it.ReadObject<char>() == 'x')do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.ReadObject<char>() == 'x')>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.ReadObject<char>() ==
'x'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.ReadObject<char>() == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3400); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<char>() == 'x'"
")"); do { *((volatile int*)__null) = 3400; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3401 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3401); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 1"
")"); do { *((volatile int*)__null) = 3401; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3402 MOZ_RELEASE_ASSERT(it.PeekObject<char>() == 'y')do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.PeekObject<char>() == 'y')>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.PeekObject<char>() ==
'y'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.PeekObject<char>() == 'y'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3402); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.PeekObject<char>() == 'y'"
")"); do { *((volatile int*)__null) = 3402; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3403 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3403); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 1"
")"); do { *((volatile int*)__null) = 3403; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3404 MOZ_RELEASE_ASSERT(it.ReadObject<char>() == 'y')do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.ReadObject<char>() == 'y')>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.ReadObject<char>() ==
'y'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.ReadObject<char>() == 'y'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3404); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<char>() == 'y'"
")"); do { *((volatile int*)__null) = 3404; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3405 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 2))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3405); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 2"
")"); do { *((volatile int*)__null) = 3405; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3406
3407 // Checking that a reader can be created from a writer.
3408 MB::Reader it2(it);
3409 MOZ_RELEASE_ASSERT(it2.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it2.CurrentIndex() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it2.CurrentIndex() == 2))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it2.CurrentIndex() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3409); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it2.CurrentIndex() == 2"
")"); do { *((volatile int*)__null) = 3409; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3410 // Or assigned.
3411 it2 = it;
3412 MOZ_RELEASE_ASSERT(it2.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it2.CurrentIndex() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it2.CurrentIndex() == 2))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it2.CurrentIndex() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3412); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it2.CurrentIndex() == 2"
")"); do { *((volatile int*)__null) = 3412; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3413
3414 // Iterator traits.
3415 static_assert(std::is_same<std::iterator_traits<MB::Reader>::difference_type,
3416 MB::Index>::value,
3417 "ModuloBuffer::Reader::difference_type should be Index");
3418 static_assert(std::is_same<std::iterator_traits<MB::Reader>::value_type,
3419 MB::Byte>::value,
3420 "ModuloBuffer::Reader::value_type should be Byte");
3421 static_assert(std::is_same<std::iterator_traits<MB::Reader>::pointer,
3422 const MB::Byte*>::value,
3423 "ModuloBuffer::Reader::pointer should be const Byte*");
3424 static_assert(std::is_same<std::iterator_traits<MB::Reader>::reference,
3425 const MB::Byte&>::value,
3426 "ModuloBuffer::Reader::reference should be const Byte&");
3427 static_assert(std::is_base_of<
3428 std::input_iterator_tag,
3429 std::iterator_traits<MB::Reader>::iterator_category>::value,
3430 "ModuloBuffer::Reader::iterator_category should be derived "
3431 "from input_iterator_tag");
3432 static_assert(std::is_base_of<
3433 std::forward_iterator_tag,
3434 std::iterator_traits<MB::Reader>::iterator_category>::value,
3435 "ModuloBuffer::Reader::iterator_category should be derived "
3436 "from forward_iterator_tag");
3437 static_assert(std::is_base_of<
3438 std::bidirectional_iterator_tag,
3439 std::iterator_traits<MB::Reader>::iterator_category>::value,
3440 "ModuloBuffer::Reader::iterator_category should be derived "
3441 "from bidirectional_iterator_tag");
3442 static_assert(
3443 std::is_same<std::iterator_traits<MB::Reader>::iterator_category,
3444 std::random_access_iterator_tag>::value,
3445 "ModuloBuffer::Reader::iterator_category should be "
3446 "random_access_iterator_tag");
3447
3448 // Use as input iterator by std::string constructor (which is only considered
3449 // with proper input iterators.)
3450 std::string s(mb.ReaderAt(0), mb.ReaderAt(2));
3451 MOZ_RELEASE_ASSERT(s == "xy")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s == "xy")>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s == "xy"))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("s == \"xy\"", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3451); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "s == \"xy\""
")"); do { *((volatile int*)__null) = 3451; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3452
3453 // Write 4-byte number at index 2.
3454 it.WriteObject(int32_t(123));
3455 MOZ_RELEASE_ASSERT(it.CurrentIndex() == 6)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == 6)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 6))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 6"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3455); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 6"
")"); do { *((volatile int*)__null) = 3455; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3456 // And another, which should now wrap around (but index continues on.)
3457 it.WriteObject(int32_t(456));
3458 MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == MBSize + 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == MBSize +
2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.CurrentIndex() == MBSize + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3458); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + 2"
")"); do { *((volatile int*)__null) = 3458; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3459 // Even though index==MBSize+2, we can read the object we wrote at 2.
3460 MOZ_RELEASE_ASSERT(it.ReadObject<int32_t>() == 123)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.ReadObject<int32_t>() == 123)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(it.ReadObject<int32_t>() == 123))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("it.ReadObject<int32_t>() == 123"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3460); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<int32_t>() == 123"
")"); do { *((volatile int*)__null) = 3460; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3461 MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + 6)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == MBSize + 6)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == MBSize +
6))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("it.CurrentIndex() == MBSize + 6", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3461); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + 6"
")"); do { *((volatile int*)__null) = 3461; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3462 // And similarly, index MBSize+6 points at the same location as index 6.
3463 MOZ_RELEASE_ASSERT(it.ReadObject<int32_t>() == 456)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.ReadObject<int32_t>() == 456)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(it.ReadObject<int32_t>() == 456))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("it.ReadObject<int32_t>() == 456"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3463); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<int32_t>() == 456"
")"); do { *((volatile int*)__null) = 3463; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3464 MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + MBSize + 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(it.CurrentIndex() == MBSize + MBSize + 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(it.CurrentIndex() == MBSize + MBSize + 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == MBSize + MBSize + 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3464); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + MBSize + 2"
")"); do { *((volatile int*)__null) = 3464; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3465}
3466
3467void TestModuloBuffer() {
3468 printf("TestModuloBuffer...\n");
3469
3470 // Testing ModuloBuffer with default template arguments.
3471 using MB = ModuloBuffer<>;
3472
3473 // Only 8-byte buffers, to easily test wrap-around.
3474 constexpr uint32_t MBSize = 8;
3475
3476 // MB with self-allocated heap buffer.
3477 MB mbByLength(MakePowerOfTwo32<MBSize>());
3478 TestModuloBuffer(mbByLength, MBSize);
3479
3480 // MB taking ownership of a provided UniquePtr to a buffer.
3481 auto uniqueBuffer = MakeUnique<uint8_t[]>(MBSize);
3482 MB mbByUniquePtr(MakeUnique<uint8_t[]>(MBSize), MakePowerOfTwo32<MBSize>());
3483 TestModuloBuffer(mbByUniquePtr, MBSize);
3484
3485 // MB using part of a buffer on the stack. The buffer is three times the
3486 // required size: The middle third is where ModuloBuffer will work, the first
3487 // and last thirds are only used to later verify that ModuloBuffer didn't go
3488 // out of its bounds.
3489 uint8_t buffer[MBSize * 3];
3490 // Pre-fill the buffer with a known pattern, so we can later see what changed.
3491 for (size_t i = 0; i < MBSize * 3; ++i) {
3492 buffer[i] = uint8_t('A' + i);
3493 }
3494 MB mbByBuffer(&buffer[MBSize], MakePowerOfTwo32<MBSize>());
3495 TestModuloBuffer(mbByBuffer, MBSize);
3496
3497 // Check that only the provided stack-based sub-buffer was modified.
3498 uint32_t changed = 0;
3499 for (size_t i = MBSize; i < MBSize * 2; ++i) {
3500 changed += (buffer[i] == uint8_t('A' + i)) ? 0 : 1;
3501 }
3502 // Expect at least 75% changes.
3503 MOZ_RELEASE_ASSERT(changed >= MBSize * 6 / 8)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(changed >= MBSize * 6 / 8)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(changed >= MBSize * 6 / 8
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"changed >= MBSize * 6 / 8", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3503); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "changed >= MBSize * 6 / 8"
")"); do { *((volatile int*)__null) = 3503; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3504
3505 // Everything around the sub-buffer should be unchanged.
3506 for (size_t i = 0; i < MBSize; ++i) {
3507 MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3507); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)"
")"); do { *((volatile int*)__null) = 3507; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3508 }
3509 for (size_t i = MBSize * 2; i < MBSize * 3; ++i) {
3510 MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3510); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)"
")"); do { *((volatile int*)__null) = 3510; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3511 }
3512
3513 // Check that move-construction is allowed. This verifies that we do not
3514 // crash from a double free, when `mbByBuffer` and `mbByStolenBuffer` are both
3515 // destroyed at the end of this function.
3516 MB mbByStolenBuffer = std::move(mbByBuffer);
3517 TestModuloBuffer(mbByStolenBuffer, MBSize);
3518
3519 // Check that only the provided stack-based sub-buffer was modified.
3520 changed = 0;
3521 for (size_t i = MBSize; i < MBSize * 2; ++i) {
3522 changed += (buffer[i] == uint8_t('A' + i)) ? 0 : 1;
3523 }
3524 // Expect at least 75% changes.
3525 MOZ_RELEASE_ASSERT(changed >= MBSize * 6 / 8)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(changed >= MBSize * 6 / 8)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(changed >= MBSize * 6 / 8
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"changed >= MBSize * 6 / 8", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3525); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "changed >= MBSize * 6 / 8"
")"); do { *((volatile int*)__null) = 3525; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3526
3527 // Everything around the sub-buffer should be unchanged.
3528 for (size_t i = 0; i < MBSize; ++i) {
3529 MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3529); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)"
")"); do { *((volatile int*)__null) = 3529; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3530 }
3531 for (size_t i = MBSize * 2; i < MBSize * 3; ++i) {
3532 MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)"
")"); do { *((volatile int*)__null) = 3532; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3533 }
3534
3535 // This test function does a `ReadInto` as directed, and checks that the
3536 // result is the same as if the copy had been done manually byte-by-byte.
3537 // `TestReadInto(3, 7, 2)` copies from index 3 to index 7, 2 bytes long.
3538 // Return the output string (from `ReadInto`) for external checks.
3539 auto TestReadInto = [](MB::Index aReadFrom, MB::Index aWriteTo,
3540 MB::Length aBytes) {
3541 constexpr uint32_t TRISize = 16;
3542
3543 // Prepare an input buffer, all different elements.
3544 uint8_t input[TRISize + 1] = "ABCDEFGHIJKLMNOP";
3545 const MB mbInput(input, MakePowerOfTwo32<TRISize>());
3546
3547 // Prepare an output buffer, different from input.
3548 uint8_t output[TRISize + 1] = "abcdefghijklmnop";
3549 MB mbOutput(output, MakePowerOfTwo32<TRISize>());
3550
3551 // Run ReadInto.
3552 auto writer = mbOutput.WriterAt(aWriteTo);
3553 mbInput.ReaderAt(aReadFrom).ReadInto(writer, aBytes);
3554
3555 // Do the same operation manually.
3556 uint8_t outputCheck[TRISize + 1] = "abcdefghijklmnop";
3557 MB mbOutputCheck(outputCheck, MakePowerOfTwo32<TRISize>());
3558 auto readerCheck = mbInput.ReaderAt(aReadFrom);
3559 auto writerCheck = mbOutputCheck.WriterAt(aWriteTo);
3560 for (MB::Length i = 0; i < aBytes; ++i) {
3561 *writerCheck++ = *readerCheck++;
3562 }
3563
3564 // Compare the two outputs.
3565 for (uint32_t i = 0; i < TRISize; ++i) {
3566# ifdef TEST_MODULOBUFFER_FAILURE_DEBUG
3567 // Only used when debugging failures.
3568 if (output[i] != outputCheck[i]) {
3569 printf(
3570 "*** from=%u to=%u bytes=%u i=%u\ninput: '%s'\noutput: "
3571 "'%s'\ncheck: '%s'\n",
3572 unsigned(aReadFrom), unsigned(aWriteTo), unsigned(aBytes),
3573 unsigned(i), input, output, outputCheck);
3574 }
3575# endif
3576 MOZ_RELEASE_ASSERT(output[i] == outputCheck[i])do { static_assert( mozilla::detail::AssertionConditionType<
decltype(output[i] == outputCheck[i])>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(output[i] == outputCheck[i])
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("output[i] == outputCheck[i]"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3576); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "output[i] == outputCheck[i]"
")"); do { *((volatile int*)__null) = 3576; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3577 }
3578
3579# ifdef TEST_MODULOBUFFER_HELPER
3580 // Only used when adding more tests.
3581 printf("*** from=%u to=%u bytes=%u output: %s\n", unsigned(aReadFrom),
3582 unsigned(aWriteTo), unsigned(aBytes), output);
3583# endif
3584
3585 return std::string(reinterpret_cast<const char*>(output));
3586 };
3587
3588 // A few manual checks:
3589 constexpr uint32_t TRISize = 16;
3590 MOZ_RELEASE_ASSERT(TestReadInto(0, 0, 0) == "abcdefghijklmnop")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(TestReadInto(0, 0, 0) == "abcdefghijklmnop")>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(TestReadInto(0, 0, 0) == "abcdefghijklmnop"))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 0, 0) == \"abcdefghijklmnop\""
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3590); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 0, 0) == \"abcdefghijklmnop\""
")"); do { *((volatile int*)__null) = 3590; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3591 MOZ_RELEASE_ASSERT(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP")>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP")))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 0, TRISize) == \"ABCDEFGHIJKLMNOP\""
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3591); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 0, TRISize) == \"ABCDEFGHIJKLMNOP\""
")"); do { *((volatile int*)__null) = 3591; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3592 MOZ_RELEASE_ASSERT(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK")>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK")))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 5, TRISize) == \"LMNOPABCDEFGHIJK\""
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 5, TRISize) == \"LMNOPABCDEFGHIJK\""
")"); do { *((volatile int*)__null) = 3592; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3593 MOZ_RELEASE_ASSERT(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE")>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE")))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(5, 0, TRISize) == \"FGHIJKLMNOPABCDE\""
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3593); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(5, 0, TRISize) == \"FGHIJKLMNOPABCDE\""
")"); do { *((volatile int*)__null) = 3593; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3594
3595 // Test everything! (16^3 = 4096, not too much.)
3596 for (MB::Index r = 0; r < TRISize; ++r) {
3597 for (MB::Index w = 0; w < TRISize; ++w) {
3598 for (MB::Length len = 0; len < TRISize; ++len) {
3599 TestReadInto(r, w, len);
3600 }
3601 }
3602 }
3603
3604 printf("TestModuloBuffer done\n");
3605}
3606
3607void TestLiteralEmptyStringView() {
3608 printf("TestLiteralEmptyStringView...\n");
3609
3610 static_assert(mozilla::LiteralEmptyStringView<char>() ==
3611 std::string_view(""));
3612 static_assert(!!mozilla::LiteralEmptyStringView<char>().data());
3613 static_assert(mozilla::LiteralEmptyStringView<char>().length() == 0);
3614
3615 static_assert(mozilla::LiteralEmptyStringView<char16_t>() ==
3616 std::basic_string_view<char16_t>(u""));
3617 static_assert(!!mozilla::LiteralEmptyStringView<char16_t>().data());
3618 static_assert(mozilla::LiteralEmptyStringView<char16_t>().length() == 0);
3619
3620 printf("TestLiteralEmptyStringView done\n");
3621}
3622
3623template <typename CHAR>
3624void TestProfilerStringView() {
3625 if constexpr (std::is_same_v<CHAR, char>) {
3626 printf("TestProfilerStringView<char>...\n");
3627 } else if constexpr (std::is_same_v<CHAR, char16_t>) {
3628 printf("TestProfilerStringView<char16_t>...\n");
3629 } else {
3630 MOZ_RELEASE_ASSERT(false,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "TestProfilerStringView only handles char and char16_t"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "TestProfilerStringView only handles char and char16_t"
")"); do { *((volatile int*)__null) = 3631; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3631 "TestProfilerStringView only handles char and char16_t")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(false)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("false" " (" "TestProfilerStringView only handles char and char16_t"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false"
") (" "TestProfilerStringView only handles char and char16_t"
")"); do { *((volatile int*)__null) = 3631; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3632 }
3633
3634 // Used to verify implicit constructions, as this will normally be used in
3635 // function parameters.
3636 auto BSV = [](mozilla::ProfilerStringView<CHAR>&& aBSV) {
3637 return std::move(aBSV);
3638 };
3639
3640 // These look like string literals, as expected by some string constructors.
3641 const CHAR empty[0 + 1] = {CHAR('\0')};
3642 const CHAR hi[2 + 1] = {
3643 CHAR('h'),
3644 CHAR('i'),
3645 CHAR('\0'),
3646 };
3647
3648 // Literal empty string.
3649 MOZ_RELEASE_ASSERT(BSV(empty).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(empty).Length() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(empty).Length() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(empty).Length() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3649); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).Length() == 0"
")"); do { *((volatile int*)__null) = 3649; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3650 MOZ_RELEASE_ASSERT(BSV(empty).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(empty).AsSpan().IsEmpty())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(empty).AsSpan().IsEmpty(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(empty).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3650); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3650; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3651 MOZ_RELEASE_ASSERT(BSV(empty).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(empty).IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(empty).IsLiteral()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(empty).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3651); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).IsLiteral()"
")"); do { *((volatile int*)__null) = 3651; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3652 MOZ_RELEASE_ASSERT(!BSV(empty).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(empty).IsReference())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!BSV(empty).IsReference())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(empty).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3652); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(empty).IsReference()"
")"); do { *((volatile int*)__null) = 3652; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3653
3654 // Literal non-empty string.
3655 MOZ_RELEASE_ASSERT(BSV(hi).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(hi).Length() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(hi).Length() == 2))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).Length() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).Length() == 2"
")"); do { *((volatile int*)__null) = 3655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3656 MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(hi).AsSpan().Elements())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(hi).AsSpan().Elements())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3656); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3656; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3657 MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(hi).AsSpan().Elements()[0] == CHAR('h'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(BSV(hi).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3657); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3657; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3658 MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(hi).AsSpan().Elements()[1] == CHAR('i'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(BSV(hi).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3658); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3658; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3659 MOZ_RELEASE_ASSERT(BSV(hi).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(hi).IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(hi).IsLiteral()))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3659); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).IsLiteral()"
")"); do { *((volatile int*)__null) = 3659; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3660 MOZ_RELEASE_ASSERT(!BSV(hi).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(hi).IsReference())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!BSV(hi).IsReference()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(hi).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3660); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(hi).IsReference()"
")"); do { *((volatile int*)__null) = 3660; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3661
3662 // std::string_view to a literal empty string.
3663 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(empty)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(empty)).Length
() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>(empty)).Length
() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>(empty)).Length() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3663); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).Length() == 0"
")"); do { *((volatile int*)__null) = 3663; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3664 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(empty)).AsSpan
().IsEmpty())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR
>(empty)).AsSpan().IsEmpty()))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3665); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3665; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3665 BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(empty)).AsSpan
().IsEmpty())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR
>(empty)).AsSpan().IsEmpty()))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3665); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3665; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3666 MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3666; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3667 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(empty)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(empty)).IsReference
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>(empty)).IsReference
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>(empty)).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).IsReference()"
")"); do { *((volatile int*)__null) = 3667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3668
3669 // std::string_view to a literal non-empty string.
3670 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).Length()
== 2)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>(hi)).Length()
== 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>(hi)).Length() == 2",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3670); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).Length() == 2"
")"); do { *((volatile int*)__null) = 3670; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3671 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR
>(hi)).AsSpan().Elements()))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3671); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3671; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3672 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3673 BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3674 CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3675 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3676 BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3677 CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan()
.Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<
CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3678 MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3678); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3678; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3679 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>(hi)).IsReference
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>(hi)).IsReference
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>(hi)).IsReference()",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3679); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).IsReference()"
")"); do { *((volatile int*)__null) = 3679; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3680
3681 // Default std::string_view points at nullptr, ProfilerStringView converts it
3682 // to the literal empty string.
3683 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>()).Length() ==
0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>()).Length() ==
0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>()).Length() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).Length() == 0"
")"); do { *((volatile int*)__null) = 3683; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3684 MOZ_RELEASE_ASSERT(!std::basic_string_view<CHAR>().data())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!std::basic_string_view<CHAR>().data())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!std::basic_string_view<CHAR>().data()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!std::basic_string_view<CHAR>().data()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!std::basic_string_view<CHAR>().data()"
")"); do { *((volatile int*)__null) = 3684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3685 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3686 MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string_view<CHAR>()).IsLiteral(
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string_view<CHAR>()).IsLiteral(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string_view<CHAR>()).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3686); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).IsLiteral()"
")"); do { *((volatile int*)__null) = 3686; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3687 MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>()).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string_view<CHAR>()).IsReference
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string_view<CHAR>()).IsReference
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!BSV(std::basic_string_view<CHAR>()).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3687); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>()).IsReference()"
")"); do { *((volatile int*)__null) = 3687; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3688
3689 // std::string to a literal empty string.
3690 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(empty)).Length() ==
0)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(empty)).Length() ==
0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string<CHAR>(empty)).Length() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3690); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).Length() == 0"
")"); do { *((volatile int*)__null) = 3690; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3691 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3691); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3691; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3692 MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>(empty)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string<CHAR>(empty)).IsLiteral
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string<CHAR>(empty)).IsLiteral
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!BSV(std::basic_string<CHAR>(empty)).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3692); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>(empty)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3692; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3693 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(empty)).IsReference
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(empty)).IsReference
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string<CHAR>(empty)).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3693); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).IsReference()"
")"); do { *((volatile int*)__null) = 3693; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3694
3695 // std::string to a literal non-empty string.
3696 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).Length() == 2
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(hi)).Length() == 2
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"BSV(std::basic_string<CHAR>(hi)).Length() == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3696); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).Length() == 2"
")"); do { *((volatile int*)__null) = 3696; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3697 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3697; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3698 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
()[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR
>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3699; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3699 CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
()[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR
>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3699; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3700 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
()[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR
>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3701; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3701 CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements
()[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR
>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3701; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3702 MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>(hi)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string<CHAR>(hi)).IsLiteral())
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string<CHAR>(hi)).IsLiteral())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(std::basic_string<CHAR>(hi)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3702); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>(hi)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3702; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3703 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>(hi)).IsReference()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>(hi)).IsReference()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"BSV(std::basic_string<CHAR>(hi)).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).IsReference()"
")"); do { *((volatile int*)__null) = 3703; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3704
3705 // Default std::string contains an empty null-terminated string.
3706 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>()).Length() == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>()).Length() == 0))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>()).Length() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3706); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).Length() == 0"
")"); do { *((volatile int*)__null) = 3706; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3707 MOZ_RELEASE_ASSERT(std::basic_string<CHAR>().data())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(std::basic_string<CHAR>().data())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(std::basic_string<CHAR>().data()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("std::basic_string<CHAR>().data()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "std::basic_string<CHAR>().data()"
")"); do { *((volatile int*)__null) = 3707; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3708 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3708); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3708; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3709 MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>()).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(std::basic_string<CHAR>()).IsLiteral())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(std::basic_string<CHAR>()).IsLiteral())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(std::basic_string<CHAR>()).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3709); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>()).IsLiteral()"
")"); do { *((volatile int*)__null) = 3709; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3710 MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(std::basic_string<CHAR>()).IsReference())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(std::basic_string<CHAR>()).IsReference()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>()).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).IsReference()"
")"); do { *((volatile int*)__null) = 3710; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3711
3712 // Class that quacks like nsTString (with Data(), Length(), IsLiteral()), to
3713 // check that ProfilerStringView can read from them.
3714 class FakeNsTString {
3715 public:
3716 FakeNsTString(const CHAR* aData, size_t aLength, bool aIsLiteral)
3717 : mData(aData), mLength(aLength), mIsLiteral(aIsLiteral) {}
3718
3719 const CHAR* Data() const { return mData; }
3720 size_t Length() const { return mLength; }
3721 bool IsLiteral() const { return mIsLiteral; }
3722
3723 private:
3724 const CHAR* mData;
3725 size_t mLength;
3726 bool mIsLiteral;
3727 };
3728
3729 // FakeNsTString to nullptr.
3730 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(nullptr, 0, true)).Length() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3730); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).Length() == 0"
")"); do { *((volatile int*)__null) = 3730; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3731 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3731); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3731; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3732 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3732); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3732; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3733 MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(nullptr, 0, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(FakeNsTString(nullptr, 0, true)).IsReference())
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(FakeNsTString(nullptr, 0, true)).IsReference())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(nullptr, 0, true)).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(nullptr, 0, true)).IsReference()"
")"); do { *((volatile int*)__null) = 3733; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3734
3735 // FakeNsTString to a literal empty string.
3736 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(empty, 0, true)).Length() == 0)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(empty, 0, true)).Length() == 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(empty, 0, true)).Length() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3736); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).Length() == 0"
")"); do { *((volatile int*)__null) = 3736; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3737 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty(
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3737); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty()"
")"); do { *((volatile int*)__null) = 3737; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3738 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(empty, 0, true)).IsLiteral())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(empty, 0, true)).IsLiteral()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(empty, 0, true)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3738); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3738; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3739 MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(empty, 0, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(FakeNsTString(empty, 0, true)).IsReference())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(FakeNsTString(empty, 0, true)).IsReference())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(empty, 0, true)).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3739); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(empty, 0, true)).IsReference()"
")"); do { *((volatile int*)__null) = 3739; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3740
3741 // FakeNsTString to a literal non-empty string.
3742 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).Length() == 2)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(hi, 2, true)).Length() == 2))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).Length() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).Length() == 2"
")"); do { *((volatile int*)__null) = 3742; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3743 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements())
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3743); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3743; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3744 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[
0] == CHAR('h'))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true
)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3745 CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[
0] == CHAR('h'))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true
)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3746 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[
1] == CHAR('i'))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true
)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3747); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3747; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3747 CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[
1] == CHAR('i'))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true
)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3747); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3747; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3748 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, true)).IsLiteral())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(BSV(FakeNsTString(hi, 2, true)).IsLiteral()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3748); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3748; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3749 MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(hi, 2, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(FakeNsTString(hi, 2, true)).IsReference())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(FakeNsTString(hi, 2, true)).IsReference()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(hi, 2, true)).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3749); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(hi, 2, true)).IsReference()"
")"); do { *((volatile int*)__null) = 3749; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3750
3751 // FakeNsTString to a non-literal non-empty string.
3752 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).Length() == 2)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(hi, 2, false)).Length() == 2))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).Length() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3752); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).Length() == 2"
")"); do { *((volatile int*)__null) = 3752; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3753 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3753); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3753; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3754 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false
)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3755); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3755; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3755 CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
[0] == CHAR('h'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false
)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3755); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3755; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3756 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false
)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3757; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3757 CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()
[1] == CHAR('i'))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false
)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3757; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3758 MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(hi, 2, false)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!BSV(FakeNsTString(hi, 2, false)).IsLiteral())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!BSV(FakeNsTString(hi, 2, false)).IsLiteral()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(hi, 2, false)).IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3758); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(hi, 2, false)).IsLiteral()"
")"); do { *((volatile int*)__null) = 3758; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3759 MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BSV(FakeNsTString(hi, 2, false)).IsReference())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BSV(FakeNsTString(hi, 2, false)).IsReference()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).IsReference()"
")"); do { *((volatile int*)__null) = 3759; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3760
3761 // Serialization and deserialization (with ownership).
3762 constexpr size_t bufferMaxSize = 1024;
3763 constexpr ProfileChunkedBuffer::Length chunkMinSize = 128;
3764 ProfileBufferChunkManagerWithLocalLimit cm(bufferMaxSize, chunkMinSize);
3765 ProfileChunkedBuffer cb(ProfileChunkedBuffer::ThreadSafety::WithMutex, cm);
3766
3767 // Literal string, serialized as raw pointer.
3768 MOZ_RELEASE_ASSERT(cb.PutObject(BSV(hi)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.PutObject(BSV(hi)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cb.PutObject(BSV(hi))))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("cb.PutObject(BSV(hi))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3768); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.PutObject(BSV(hi))"
")"); do { *((volatile int*)__null) = 3768; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3769 {
3770 unsigned read = 0;
3771 ProfilerStringView<CHAR> outerBSV;
3772 cb.ReadEach([&](ProfileBufferEntryReader& aER) {
3773 ++read;
3774 auto bsv = aER.ReadObject<ProfilerStringView<CHAR>>();
3775 MOZ_RELEASE_ASSERT(bsv.Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.Length() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.Length() == 2))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3775); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == 2"
")"); do { *((volatile int*)__null) = 3775; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3776 MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.AsSpan().Elements())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.AsSpan().Elements()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3776); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3776; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3777 MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.AsSpan().Elements()[0] == CHAR('h'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(bsv.AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3777; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3778 MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.AsSpan().Elements()[1] == CHAR('i'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(bsv.AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3778); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3778; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3779 MOZ_RELEASE_ASSERT(bsv.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.IsLiteral()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("bsv.IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3779); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.IsLiteral()"
")"); do { *((volatile int*)__null) = 3779; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3780 MOZ_RELEASE_ASSERT(!bsv.IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!bsv.IsReference())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!bsv.IsReference()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!bsv.IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3780); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!bsv.IsReference()"
")"); do { *((volatile int*)__null) = 3780; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3781 outerBSV = std::move(bsv);
3782 });
3783 MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3783); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1"
")"); do { *((volatile int*)__null) = 3783; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3784 MOZ_RELEASE_ASSERT(outerBSV.Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.Length() == 2)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(outerBSV.Length() == 2))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.Length() == 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.Length() == 2"
")"); do { *((volatile int*)__null) = 3784; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3785 MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.AsSpan().Elements())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(outerBSV.AsSpan().Elements()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"outerBSV.AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3785); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3785; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3786 MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.AsSpan().Elements()[0] == CHAR('h'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(outerBSV.AsSpan().Elements()[0] == CHAR('h')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[0] == CHAR('h')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3786); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[0] == CHAR('h')"
")"); do { *((volatile int*)__null) = 3786; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3787 MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.AsSpan().Elements()[1] == CHAR('i'))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(outerBSV.AsSpan().Elements()[1] == CHAR('i')))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[1] == CHAR('i')"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[1] == CHAR('i')"
")"); do { *((volatile int*)__null) = 3787; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3788 MOZ_RELEASE_ASSERT(outerBSV.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(outerBSV.IsLiteral()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3788); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.IsLiteral()"
")"); do { *((volatile int*)__null) = 3788; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3789 MOZ_RELEASE_ASSERT(!outerBSV.IsReference())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!outerBSV.IsReference())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!outerBSV.IsReference()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!outerBSV.IsReference()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3789); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!outerBSV.IsReference()"
")"); do { *((volatile int*)__null) = 3789; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3790 }
3791
3792 MOZ_RELEASE_ASSERT(cb.GetState().mRangeStart == 1u)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.GetState().mRangeStart == 1u)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cb.GetState().mRangeStart ==
1u))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.GetState().mRangeStart == 1u", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3792); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.GetState().mRangeStart == 1u"
")"); do { *((volatile int*)__null) = 3792; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3793
3794 cb.Clear();
3795
3796 // Non-literal string, content is serialized.
3797
3798 // We'll try to write 4 strings, such that the 4th one will cross into the
3799 // next chunk.
3800 unsigned guessedChunkBytes = unsigned(cb.GetState().mRangeStart) - 1u;
3801 static constexpr unsigned stringCount = 4u;
3802 const unsigned stringSize =
3803 guessedChunkBytes / stringCount / sizeof(CHAR) + 3u;
3804
3805 std::basic_string<CHAR> longString;
3806 longString.reserve(stringSize);
3807 for (unsigned i = 0; i < stringSize; ++i) {
3808 longString += CHAR('0' + i);
3809 }
3810
3811 for (unsigned i = 0; i < stringCount; ++i) {
3812 MOZ_RELEASE_ASSERT(cb.PutObject(BSV(longString)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cb.PutObject(BSV(longString)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cb.PutObject(BSV(longString)
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cb.PutObject(BSV(longString))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3812); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.PutObject(BSV(longString))"
")"); do { *((volatile int*)__null) = 3812; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3813 }
3814
3815 {
3816 unsigned read = 0;
3817 ProfilerStringView<CHAR> outerBSV;
3818 cb.ReadEach([&](ProfileBufferEntryReader& aER) {
3819 ++read;
3820 {
3821 auto bsv = aER.ReadObject<ProfilerStringView<CHAR>>();
3822 MOZ_RELEASE_ASSERT(bsv.Length() == stringSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.Length() == stringSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.Length() == stringSize))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == stringSize"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3822); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == stringSize"
")"); do { *((volatile int*)__null) = 3822; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3823 MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.AsSpan().Elements())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.AsSpan().Elements()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3823; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3824 for (unsigned i = 0; i < stringSize; ++i) {
3825 MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[i] == CHAR('0' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.AsSpan().Elements()[i] == CHAR('0' + i))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(bsv.AsSpan().Elements()[i] == CHAR('0' + i)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[i] == CHAR('0' + i)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3825); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[i] == CHAR('0' + i)"
")"); do { *((volatile int*)__null) = 3825; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3826 longString += '0' + i;
3827 }
3828 MOZ_RELEASE_ASSERT(!bsv.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!bsv.IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!bsv.IsLiteral()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!bsv.IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!bsv.IsLiteral()"
")"); do { *((volatile int*)__null) = 3828; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3829 // The first 3 should be references (because they fit in one chunk, so
3830 // they can be referenced directly), which the 4th one have to be copied
3831 // out of two chunks and stitched back together.
3832 MOZ_RELEASE_ASSERT(bsv.IsReference() == (read != 4))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.IsReference() == (read != 4))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(bsv.IsReference() == (read !=
4)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("bsv.IsReference() == (read != 4)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3832); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.IsReference() == (read != 4)"
")"); do { *((volatile int*)__null) = 3832; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3833
3834 // Test move of ownership.
3835 outerBSV = std::move(bsv);
3836 // After a move, references stay complete, while a non-reference had a
3837 // buffer that has been moved out.
3838 // NOLINTNEXTLINE(bugprone-use-after-move,clang-analyzer-cplusplus.Move)
3839 MOZ_RELEASE_ASSERT(bsv.Length() == ((read != 4) ? stringSize : 0))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(bsv.Length() == ((read != 4) ? stringSize : 0))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(bsv.Length() == ((read != 4) ? stringSize : 0)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == ((read != 4) ? stringSize : 0)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3839); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == ((read != 4) ? stringSize : 0)"
")"); do { *((volatile int*)__null) = 3839; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3840 }
3841
3842 MOZ_RELEASE_ASSERT(outerBSV.Length() == stringSize)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.Length() == stringSize)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(outerBSV.Length() == stringSize
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"outerBSV.Length() == stringSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3842); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.Length() == stringSize"
")"); do { *((volatile int*)__null) = 3842; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3843 MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.AsSpan().Elements())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(outerBSV.AsSpan().Elements()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"outerBSV.AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3843); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()"
")"); do { *((volatile int*)__null) = 3843; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3844 for (unsigned i = 0; i < stringSize; ++i) {
3845 MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3845); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)"
")"); do { *((volatile int*)__null) = 3845; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3846 longString += '0' + i;
3847 }
3848 MOZ_RELEASE_ASSERT(!outerBSV.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!outerBSV.IsLiteral())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!outerBSV.IsLiteral()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!outerBSV.IsLiteral()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3848); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!outerBSV.IsLiteral()"
")"); do { *((volatile int*)__null) = 3848; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3849 MOZ_RELEASE_ASSERT(outerBSV.IsReference() == (read != 4))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(outerBSV.IsReference() == (read != 4))>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(outerBSV.IsReference() == (read != 4)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("outerBSV.IsReference() == (read != 4)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3849); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.IsReference() == (read != 4)"
")"); do { *((volatile int*)__null) = 3849; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3850 });
3851 MOZ_RELEASE_ASSERT(read == 4)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(read == 4)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(read == 4))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("read == 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3851); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 4"
")"); do { *((volatile int*)__null) = 3851; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3852 }
3853
3854 if constexpr (std::is_same_v<CHAR, char>) {
3855 printf("TestProfilerStringView<char> done\n");
3856 } else if constexpr (std::is_same_v<CHAR, char16_t>) {
3857 printf("TestProfilerStringView<char16_t> done\n");
3858 }
3859}
3860
3861void TestProfilerDependencies() {
3862 TestPowerOfTwoMask();
3863 TestPowerOfTwo();
3864 TestLEB128();
3865 TestJSONTimeOutput();
3866 TestChunk();
3867 TestChunkManagerSingle();
3868 TestChunkManagerWithLocalLimit();
3869 TestControlledChunkManagerUpdate();
3870 TestControlledChunkManagerWithLocalLimit();
3871 TestChunkedBuffer();
3872 TestChunkedBufferSingle();
3873 TestModuloBuffer();
3874 TestLiteralEmptyStringView();
3875 TestProfilerStringView<char>();
3876 TestProfilerStringView<char16_t>();
3877}
3878
3879// Increase the depth, to a maximum (to avoid too-deep recursion).
3880static constexpr size_t NextDepth(size_t aDepth) {
3881 constexpr size_t MAX_DEPTH = 128;
3882 return (aDepth < MAX_DEPTH) ? (aDepth + 1) : aDepth;
3883}
3884
3885Atomic<bool, Relaxed> sStopFibonacci;
3886
3887// Compute fibonacci the hard way (recursively: `f(n)=f(n-1)+f(n-2)`), and
3888// prevent inlining.
3889// The template parameter makes each depth be a separate function, to better
3890// distinguish them in the profiler output.
3891template <size_t DEPTH = 0>
3892MOZ_NEVER_INLINE__attribute__((noinline)) unsigned long long Fibonacci(unsigned long long n) {
3893 AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fib", OTHER, std::to_string(DEPTH))Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace(std::to_string(DEPTH
)); raiiObjectString.emplace( "fib", autoStr->c_str(), ::mozilla
::baseprofiler::ProfilingCategoryPair::OTHER); }
;
1
Calling defaulted default constructor for 'Maybe<mozilla::baseprofiler::AutoProfilerLabel>'
12
Returning from default constructor for 'Maybe<mozilla::baseprofiler::AutoProfilerLabel>'
13
Assuming the condition is false
14
Taking false branch
3894 if (n == 0) {
15
Assuming 'n' is equal to 0
16
Taking true branch
3895 return 0;
17
Calling implicit destructor for 'Maybe<mozilla::baseprofiler::AutoProfilerLabel>'
18
Calling '~MaybeStorage'
3896 }
3897 if (n == 1) {
3898 return 1;
3899 }
3900 if (DEPTH < 5 && sStopFibonacci) {
3901 return 1'000'000'000;
3902 }
3903 TimeStamp start = TimeStamp::Now();
3904 static constexpr size_t MAX_MARKER_DEPTH = 10;
3905 unsigned long long f2 = Fibonacci<NextDepth(DEPTH)>(n - 2);
3906 if (DEPTH == 0) {
3907 BASE_PROFILER_MARKER_UNTYPED("Half-way through Fibonacci", OTHER)do { ; ::mozilla::baseprofiler::AddMarker( "Half-way through Fibonacci"
, ::mozilla::baseprofiler::category::OTHER); } while (false)
;
3908 }
3909 unsigned long long f1 = Fibonacci<NextDepth(DEPTH)>(n - 1);
3910 if (DEPTH < MAX_MARKER_DEPTH) {
3911 BASE_PROFILER_MARKER_TEXT("fib", OTHER,do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla::
baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom
(start), ::mozilla::baseprofiler::markers::TextMarker{}, std::
to_string(DEPTH)); } while (false)
3912 MarkerTiming::IntervalUntilNowFrom(start),do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla::
baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom
(start), ::mozilla::baseprofiler::markers::TextMarker{}, std::
to_string(DEPTH)); } while (false)
3913 std::to_string(DEPTH))do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla::
baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom
(start), ::mozilla::baseprofiler::markers::TextMarker{}, std::
to_string(DEPTH)); } while (false)
;
3914 }
3915 return f2 + f1;
3916}
3917
3918void TestProfiler() {
3919 printf("TestProfiler starting -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n",
3920 uint64_t(baseprofiler::profiler_current_process_id().ToNumber()),
3921 uint64_t(baseprofiler::profiler_current_thread_id().ToNumber()));
3922 // ::SleepMilli(10000);
3923
3924 TestProfilerDependencies();
3925
3926 {
3927 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!baseprofiler::profiler_is_active
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3927); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_is_active()"
")"); do { *((volatile int*)__null) = 3927; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3928 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_being_profiled())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3928); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()"
")"); do { *((volatile int*)__null) = 3928; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3929 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3929); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()"
")"); do { *((volatile int*)__null) = 3929; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3930
3931 const baseprofiler::BaseProfilerThreadId mainThreadId =
3932 mozilla::baseprofiler::profiler_current_thread_id();
3933
3934 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_main_thread_id() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId"
")"); do { *((volatile int*)__null) = 3935; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3935 mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId"
")"); do { *((volatile int*)__null) = 3935; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3936 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_is_main_thread())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_is_main_thread()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::profiler_is_main_thread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3936); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_is_main_thread()"
")"); do { *((volatile int*)__null) = 3936; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3937
3938 std::thread testThread([&]() {
3939 const baseprofiler::BaseProfilerThreadId testThreadId =
3940 mozilla::baseprofiler::profiler_current_thread_id();
3941 MOZ_RELEASE_ASSERT(testThreadId != mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(testThreadId != mainThreadId)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(testThreadId != mainThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"testThreadId != mainThreadId", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3941); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId != mainThreadId"
")"); do { *((volatile int*)__null) = 3941; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3942
3943 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_main_thread_id() !=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mozilla::baseprofiler::profiler_main_thread_id() != testThreadId"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId"
")"); do { *((volatile int*)__null) = 3944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3944 testThreadId)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"mozilla::baseprofiler::profiler_main_thread_id() != testThreadId"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId"
")"); do { *((volatile int*)__null) = 3944; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3945 MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_is_main_thread())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_is_main_thread())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_is_main_thread()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3945); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_is_main_thread()"
")"); do { *((volatile int*)__null) = 3945; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3946 });
3947 testThread.join();
3948
3949 printf("profiler_start()...\n");
3950 Vector<const char*> filters;
3951 // Profile all registered threads.
3952 MOZ_RELEASE_ASSERT(filters.append(""))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(filters.append(""))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(filters.append("")))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("filters.append(\"\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3952); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "filters.append(\"\")"
")"); do { *((volatile int*)__null) = 3952; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3953 const uint32_t features = baseprofiler::ProfilerFeature::StackWalk;
3954 baseprofiler::profiler_start(baseprofiler::BASE_PROFILER_DEFAULT_ENTRIES,
3955 BASE_PROFILER_DEFAULT_INTERVAL1, features,
3956 filters.begin(), filters.length());
3957
3958 MOZ_RELEASE_ASSERT(baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::profiler_is_active
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3958); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::profiler_is_active()"
")"); do { *((volatile int*)__null) = 3958; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3959 MOZ_RELEASE_ASSERT(baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::profiler_thread_is_being_profiled())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::profiler_thread_is_being_profiled())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::profiler_thread_is_being_profiled()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3959); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::profiler_thread_is_being_profiled()"
")"); do { *((volatile int*)__null) = 3959; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3960 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 3960); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()"
")"); do { *((volatile int*)__null) = 3960; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3961
3962 sStopFibonacci = false;
3963
3964 std::thread threadFib([]() {
3965 AUTO_BASE_PROFILER_REGISTER_THREAD("fibonacci")::mozilla::baseprofiler::AutoProfilerRegisterThread raiiObject3965
("fibonacci")
;
3966 SleepMilli(5);
3967 auto cause = baseprofiler::profiler_capture_backtrace();
3968 AUTO_BASE_PROFILER_MARKER_TEXT(::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970
( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack
::TakeBacktrace(std::move(cause)), "First leaf call")
3969 "fibonacci", OTHER, MarkerStack::TakeBacktrace(std::move(cause)),::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970
( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack
::TakeBacktrace(std::move(cause)), "First leaf call")
3970 "First leaf call")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970
( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack
::TakeBacktrace(std::move(cause)), "First leaf call")
;
3971 static const unsigned long long fibStart = 37;
3972 printf("Fibonacci(%llu)...\n", fibStart);
3973 AUTO_BASE_PROFILER_LABEL("Label around Fibonacci", OTHER)::mozilla::baseprofiler::AutoProfilerLabel raiiObject3973( "Label around Fibonacci"
, nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair::OTHER
)
;
3974
3975 unsigned long long f = Fibonacci(fibStart);
3976 printf("Fibonacci(%llu) = %llu\n", fibStart, f);
3977 });
3978
3979 std::thread threadCancelFib([]() {
3980 AUTO_BASE_PROFILER_REGISTER_THREAD("fibonacci canceller")::mozilla::baseprofiler::AutoProfilerRegisterThread raiiObject3980
("fibonacci canceller")
;
3981 SleepMilli(5);
3982 AUTO_BASE_PROFILER_MARKER_TEXT("fibonacci", OTHER, {}, "Canceller")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3982
( "fibonacci", ::mozilla::baseprofiler::category::OTHER, {}, "Canceller"
)
;
3983 static const int waitMaxSeconds = 10;
3984 for (int i = 0; i < waitMaxSeconds; ++i) {
3985 if (sStopFibonacci) {
3986 AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fibCancel", OTHER,Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace(std::to_string(i));
raiiObjectString.emplace( "fibCancel", autoStr->c_str(), ::
mozilla::baseprofiler::ProfilingCategoryPair::OTHER); }
3987 std::to_string(i))Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace(std::to_string(i));
raiiObjectString.emplace( "fibCancel", autoStr->c_str(), ::
mozilla::baseprofiler::ProfilingCategoryPair::OTHER); }
;
3988 return;
3989 }
3990 AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject3990;
3991 SleepMilli(1000);
3992 }
3993 AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fibCancel", OTHER,Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace("Cancelling!"); raiiObjectString
.emplace( "fibCancel", autoStr->c_str(), ::mozilla::baseprofiler
::ProfilingCategoryPair::OTHER); }
3994 "Cancelling!")Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace("Cancelling!"); raiiObjectString
.emplace( "fibCancel", autoStr->c_str(), ::mozilla::baseprofiler
::ProfilingCategoryPair::OTHER); }
;
3995 sStopFibonacci = true;
3996 });
3997
3998 {
3999 AUTO_BASE_PROFILER_MARKER_TEXT("main thread", OTHER, {},::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4000
( "main thread", ::mozilla::baseprofiler::category::OTHER, {}
, "joining fibonacci thread")
4000 "joining fibonacci thread")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4000
( "main thread", ::mozilla::baseprofiler::category::OTHER, {}
, "joining fibonacci thread")
;
4001 AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4001;
4002 threadFib.join();
4003 }
4004
4005 {
4006 AUTO_BASE_PROFILER_MARKER_TEXT("main thread", OTHER, {},::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4007
( "main thread", ::mozilla::baseprofiler::category::OTHER, {}
, "joining fibonacci-canceller thread")
4007 "joining fibonacci-canceller thread")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4007
( "main thread", ::mozilla::baseprofiler::category::OTHER, {}
, "joining fibonacci-canceller thread")
;
4008 sStopFibonacci = true;
4009 AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4009;
4010 threadCancelFib.join();
4011 }
4012
4013 // Just making sure all payloads know how to (de)serialize and stream.
4014
4015 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4016 baseprofiler::AddMarker("markers 2.0 without options (omitted)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4017 mozilla::baseprofiler::category::OTHER))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4018
4019 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {})))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4020 "markers 2.0 without options (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {})))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4021 mozilla::baseprofiler::category::OTHER, {}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {})))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})"
")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4022
4023 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4024 "markers 2.0 without options (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4025 mozilla::baseprofiler::category::OTHER, MarkerOptions()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions()))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())"
")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4026
4027 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4028 "markers 2.0 without options (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4029 mozilla::baseprofiler::category::OTHER, MarkerOptions{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{}))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})"
")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4030
4031 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4032 "markers 2.0 with one option (implicit)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4033 mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4034
4035 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4036 "markers 2.0 with one option (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4037 mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4038
4039 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4040 baseprofiler::AddMarker("markers 2.0 with one option (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4041 mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4042 MarkerOptions(MarkerInnerWindowId(123))))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))"
")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4043
4044 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4045 "markers 2.0 with one option (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4046 mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4047 MarkerOptions{MarkerInnerWindowId(123)}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})"
")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4048
4049 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4050 "markers 2.0 with two options (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4051 mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4052 {MarkerInnerWindowId(123), MarkerStack::Capture()}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)"
, mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4053
4054 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture())))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture()))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4055 "markers 2.0 with two options (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture())))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture()))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4056 mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture())))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture()))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4057 MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture())))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture())))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId
(123), MarkerStack::Capture()))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))"
")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4058
4059 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4060 "markers 2.0 with two options (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4061 mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4062 MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)"
, mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId
(123), MarkerStack::Capture()})))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})"
")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4063
4064 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4065 baseprofiler::AddMarker("default-templated markers 2.0 without options",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4066 mozilla::baseprofiler::category::OTHER))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)"
")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4067
4068 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4069 "default-templated markers 2.0 with option",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4070 mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))"
")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4071
4072 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4073 "explicitly-default-templated markers 2.0 without options",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4074 mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4075 ::mozilla::baseprofiler::markers::NoPayload{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{}))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options"
, mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler
::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4076
4077 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4078 "explicitly-default-templated markers 2.0 with option",do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4079 mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4080 ::mozilla::baseprofiler::markers::NoPayload{}))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option"
, mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId
(123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})"
")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4081
4082 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing
{}, "category"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::Tracing{}, "category")))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4083 "tracing", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing
{}, "category"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::Tracing{}, "category")))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4084 mozilla::baseprofiler::markers::Tracing{}, "category"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing
{}, "category"))>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::Tracing{}, "category")))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4085
4086 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker
{}, "text text"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::TextMarker{}, "text text")))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4087 "text", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker
{}, "text text"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::TextMarker{}, "text text")))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4088 mozilla::baseprofiler::markers::TextMarker{}, "text text"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker
{}, "text text"))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::TextMarker{}, "text text")))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4089
4090 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4091 "media sample", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4092 mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler
::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4093
4094 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video falling behind", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4095 "video falling behind", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video falling behind", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4096 mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video falling behind", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4097
4098 MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video sink render", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4099 "video sink render", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video sink render", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4100 mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(baseprofiler::AddMarker( "video sink render", mozilla
::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers
::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render"
, mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler
::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)"
")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4101
4102 printf("Sleep 1s...\n");
4103 {
4104 AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4104;
4105 SleepMilli(1000);
4106 }
4107
4108 printf("baseprofiler_pause()...\n");
4109 baseprofiler::profiler_pause();
4110
4111 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_being_profiled())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4111); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()"
")"); do { *((volatile int*)__null) = 4111; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4112
4113 Maybe<baseprofiler::ProfilerBufferInfo> info =
4114 baseprofiler::profiler_get_buffer_info();
4115 MOZ_RELEASE_ASSERT(info.isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(info.isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(info.isSome()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("info.isSome()",
"/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4115); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "info.isSome()"
")"); do { *((volatile int*)__null) = 4115; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4116 printf("Profiler buffer range: %llu .. %llu (%llu bytes)\n",
4117 static_cast<unsigned long long>(info->mRangeStart),
4118 static_cast<unsigned long long>(info->mRangeEnd),
4119 // sizeof(ProfileBufferEntry) == 9
4120 (static_cast<unsigned long long>(info->mRangeEnd) -
4121 static_cast<unsigned long long>(info->mRangeStart)) *
4122 9);
4123 printf("Stats: min(us) .. mean(us) .. max(us) [count]\n");
4124 printf("- Intervals: %7.1f .. %7.1f .. %7.1f [%u]\n",
4125 info->mIntervalsUs.min,
4126 info->mIntervalsUs.sum / info->mIntervalsUs.n,
4127 info->mIntervalsUs.max, info->mIntervalsUs.n);
4128 printf("- Overheads: %7.1f .. %7.1f .. %7.1f [%u]\n",
4129 info->mOverheadsUs.min,
4130 info->mOverheadsUs.sum / info->mOverheadsUs.n,
4131 info->mOverheadsUs.max, info->mOverheadsUs.n);
4132 printf(" - Locking: %7.1f .. %7.1f .. %7.1f [%u]\n",
4133 info->mLockingsUs.min, info->mLockingsUs.sum / info->mLockingsUs.n,
4134 info->mLockingsUs.max, info->mLockingsUs.n);
4135 printf(" - Clearning: %7.1f .. %7.1f .. %7.1f [%u]\n",
4136 info->mCleaningsUs.min,
4137 info->mCleaningsUs.sum / info->mCleaningsUs.n,
4138 info->mCleaningsUs.max, info->mCleaningsUs.n);
4139 printf(" - Counters: %7.1f .. %7.1f .. %7.1f [%u]\n",
4140 info->mCountersUs.min, info->mCountersUs.sum / info->mCountersUs.n,
4141 info->mCountersUs.max, info->mCountersUs.n);
4142 printf(" - Threads: %7.1f .. %7.1f .. %7.1f [%u]\n",
4143 info->mThreadsUs.min, info->mThreadsUs.sum / info->mThreadsUs.n,
4144 info->mThreadsUs.max, info->mThreadsUs.n);
4145
4146 printf("baseprofiler_get_profile()...\n");
4147 UniquePtr<char[]> profile = baseprofiler::profiler_get_profile();
4148
4149 // Use a string view over the profile contents, for easier testing.
4150 std::string_view profileSV = profile.get();
4151
4152 constexpr const auto svnpos = std::string_view::npos;
4153 // TODO: Properly parse profile and check fields.
4154 // Check for some expected marker schema JSON output.
4155 MOZ_RELEASE_ASSERT(profileSV.find("\"markerSchema\":[") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"markerSchema\":[") != svnpos)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(profileSV.find("\"markerSchema\":[") != svnpos))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"markerSchema\\\":[\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4155); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"markerSchema\\\":[\") != svnpos"
")"); do { *((volatile int*)__null) = 4155; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4156 MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"Text\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"name\":\"Text\",") != svnpos)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(profileSV.find("\"name\":\"Text\",") != svnpos))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"name\\\":\\\"Text\\\",\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4156); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"Text\\\",\") != svnpos"
")"); do { *((volatile int*)__null) = 4156; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4157 MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"tracing\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"name\":\"tracing\",") != svnpos)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(profileSV.find("\"name\":\"tracing\",") != svnpos)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"name\\\":\\\"tracing\\\",\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4157); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"tracing\\\",\") != svnpos"
")"); do { *((volatile int*)__null) = 4157; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4158 MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"MediaSample\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"name\":\"MediaSample\",") != svnpos
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(profileSV.find("\"name\":\"MediaSample\",") != svnpos
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"profileSV.find(\"\\\"name\\\":\\\"MediaSample\\\",\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"MediaSample\\\",\") != svnpos"
")"); do { *((volatile int*)__null) = 4158; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4159 MOZ_RELEASE_ASSERT(profileSV.find("\"display\":[") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"display\":[") != svnpos)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(profileSV.find("\"display\":[") != svnpos))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"display\\\":[\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4159); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"display\\\":[\") != svnpos"
")"); do { *((volatile int*)__null) = 4159; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4160 MOZ_RELEASE_ASSERT(profileSV.find("\"marker-chart\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"marker-chart\"") != svnpos)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(profileSV.find("\"marker-chart\"") != svnpos))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"marker-chart\\\"\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4160); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"marker-chart\\\"\") != svnpos"
")"); do { *((volatile int*)__null) = 4160; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4161 MOZ_RELEASE_ASSERT(profileSV.find("\"marker-table\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"marker-table\"") != svnpos)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(profileSV.find("\"marker-table\"") != svnpos))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"marker-table\\\"\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4161); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"marker-table\\\"\") != svnpos"
")"); do { *((volatile int*)__null) = 4161; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4162 MOZ_RELEASE_ASSERT(profileSV.find("\"format\":\"string\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(profileSV.find("\"format\":\"string\"") != svnpos)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(profileSV.find("\"format\":\"string\"") != svnpos)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"format\\\":\\\"string\\\"\") != svnpos"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4162); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"format\\\":\\\"string\\\"\") != svnpos"
")"); do { *((volatile int*)__null) = 4162; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4163 // TODO: Add more checks for what's expected in the profile. Some of them
4164 // are done in gtest's.
4165
4166 printf("baseprofiler_save_profile_to_file()...\n");
4167 baseprofiler::baseprofiler_save_profile_to_file(
4168 "TestProfiler_profile.json");
4169
4170 printf("profiler_stop()...\n");
4171 baseprofiler::profiler_stop();
4172
4173 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!baseprofiler::profiler_is_active
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4173); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_is_active()"
")"); do { *((volatile int*)__null) = 4173; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4174 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_being_profiled())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4174); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()"
")"); do { *((volatile int*)__null) = 4174; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4175 MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4175); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()"
")"); do { *((volatile int*)__null) = 4175; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4176
4177 printf("profiler_shutdown()...\n");
4178 }
4179
4180 printf("TestProfiler done\n");
4181}
4182
4183// Minimal string escaping, similar to how C++ stringliterals should be entered,
4184// to help update comparison strings in tests below.
4185void printEscaped(std::string_view aString) {
4186 for (const char c : aString) {
4187 switch (c) {
4188 case '\n':
4189 fprintf(stderrstderr, "\\n\n");
4190 break;
4191 case '"':
4192 fprintf(stderrstderr, "\\\"");
4193 break;
4194 case '\\':
4195 fprintf(stderrstderr, "\\\\");
4196 break;
4197 default:
4198 if (c >= ' ' && c <= '~') {
4199 fprintf(stderrstderr, "%c", c);
4200 } else {
4201 fprintf(stderrstderr, "\\x%02x", unsigned(c));
4202 }
4203 break;
4204 }
4205 }
4206}
4207
4208// Run aF(SpliceableChunkedJSONWriter&, UniqueJSONStrings&) from inside a JSON
4209// array, then output the string table, and compare the full output to
4210// aExpected.
4211template <typename F>
4212static void VerifyUniqueStringContents(
4213 F&& aF, std::string_view aExpectedData,
4214 std::string_view aExpectedUniqueStrings,
4215 mozilla::baseprofiler::UniqueJSONStrings* aUniqueStringsOrNull = nullptr) {
4216 mozilla::baseprofiler::SpliceableChunkedJSONWriter writer{
4217 FailureLatchInfallibleSource::Singleton()};
4218
4219 MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.ChunkedWriteFunc().Fallible())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(!writer.ChunkedWriteFunc().Fallible()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4219); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Fallible()"
")"); do { *((volatile int*)__null) = 4219; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4220 MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.ChunkedWriteFunc().Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.ChunkedWriteFunc().Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!writer.ChunkedWriteFunc().Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4220); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Failed()"
")"); do { *((volatile int*)__null) = 4220; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4221 MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.ChunkedWriteFunc().GetFailure())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!writer.ChunkedWriteFunc().GetFailure()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().GetFailure()"
")"); do { *((volatile int*)__null) = 4221; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4222 MOZ_RELEASE_ASSERT(&writer.ChunkedWriteFunc().SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&writer.ChunkedWriteFunc().SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&writer.ChunkedWriteFunc().SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4223); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4223; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4223 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&writer.ChunkedWriteFunc().SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&writer.ChunkedWriteFunc().SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4223); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4223; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4224 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4225 &std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4226 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4227
4228 MOZ_RELEASE_ASSERT(!writer.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.Fallible()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("!writer.Fallible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4228); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Fallible()"
")"); do { *((volatile int*)__null) = 4228; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4229 MOZ_RELEASE_ASSERT(!writer.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!writer.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4229); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Failed()"
")"); do { *((volatile int*)__null) = 4229; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4230 MOZ_RELEASE_ASSERT(!writer.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.GetFailure()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!writer.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4230); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.GetFailure()"
")"); do { *((volatile int*)__null) = 4230; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4231 MOZ_RELEASE_ASSERT(&writer.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&writer.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4232); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4232; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4232 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource
::Singleton())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(&writer.SourceFailureLatch() ==
&mozilla::FailureLatchInfallibleSource::Singleton()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4232); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4232; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4233 MOZ_RELEASE_ASSERT(&std::as_const(writer).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(writer).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(writer).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4234; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4234 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(writer).SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&std::as_const(writer).SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4234; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4235
4236 // By default use a local UniqueJSONStrings, otherwise use the one provided.
4237 mozilla::baseprofiler::UniqueJSONStrings localUniqueStrings{
4238 FailureLatchInfallibleSource::Singleton()};
4239 MOZ_RELEASE_ASSERT(!localUniqueStrings.Fallible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!localUniqueStrings.Fallible())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.Fallible
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!localUniqueStrings.Fallible()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.Fallible()"
")"); do { *((volatile int*)__null) = 4239; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4240 MOZ_RELEASE_ASSERT(!localUniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!localUniqueStrings.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.Failed()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!localUniqueStrings.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.Failed()"
")"); do { *((volatile int*)__null) = 4240; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4241 MOZ_RELEASE_ASSERT(!localUniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!localUniqueStrings.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.GetFailure
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!localUniqueStrings.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4241); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.GetFailure()"
")"); do { *((volatile int*)__null) = 4241; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4242 MOZ_RELEASE_ASSERT(&localUniqueStrings.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&localUniqueStrings.SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&localUniqueStrings.SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4243; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4243 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&localUniqueStrings.SourceFailureLatch() == &
mozilla::FailureLatchInfallibleSource::Singleton())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(&localUniqueStrings.SourceFailureLatch() == &mozilla
::FailureLatchInfallibleSource::Singleton()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4243; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4244 MOZ_RELEASE_ASSERT(&std::as_const(localUniqueStrings).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(localUniqueStrings).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(localUniqueStrings).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4245; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4245 &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(&std::as_const(localUniqueStrings).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(&std::as_const(localUniqueStrings).SourceFailureLatch
() == &mozilla::FailureLatchInfallibleSource::Singleton()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()"
")"); do { *((volatile int*)__null) = 4245; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4246
4247 mozilla::baseprofiler::UniqueJSONStrings& uniqueStrings =
4248 aUniqueStringsOrNull ? *aUniqueStringsOrNull : localUniqueStrings;
4249 MOZ_RELEASE_ASSERT(!uniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!uniqueStrings.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!uniqueStrings.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.Failed()"
")"); do { *((volatile int*)__null) = 4249; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4250 MOZ_RELEASE_ASSERT(!uniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!uniqueStrings.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!uniqueStrings.GetFailure())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.GetFailure()"
")"); do { *((volatile int*)__null) = 4250; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4251
4252 writer.Start();
4253 {
4254 writer.StartArrayProperty("data");
4255 { std::forward<F>(aF)(writer, uniqueStrings); }
4256 writer.EndArray();
4257
4258 writer.StartArrayProperty("stringTable");
4259 { uniqueStrings.SpliceStringTableElements(writer); }
4260 writer.EndArray();
4261 }
4262 writer.End();
4263
4264 MOZ_RELEASE_ASSERT(!uniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!uniqueStrings.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!uniqueStrings.Failed()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.Failed()"
")"); do { *((volatile int*)__null) = 4264; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4265 MOZ_RELEASE_ASSERT(!uniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!uniqueStrings.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!uniqueStrings.GetFailure())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.GetFailure()"
")"); do { *((volatile int*)__null) = 4265; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4266
4267 MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.ChunkedWriteFunc().Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.ChunkedWriteFunc().Failed
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!writer.ChunkedWriteFunc().Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4267); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Failed()"
")"); do { *((volatile int*)__null) = 4267; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4268 MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.ChunkedWriteFunc().GetFailure())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!writer.ChunkedWriteFunc().GetFailure()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4268); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().GetFailure()"
")"); do { *((volatile int*)__null) = 4268; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4269
4270 MOZ_RELEASE_ASSERT(!writer.Failed())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.Failed())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.Failed()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!writer.Failed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4270); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Failed()"
")"); do { *((volatile int*)__null) = 4270; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4271 MOZ_RELEASE_ASSERT(!writer.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!writer.GetFailure())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!writer.GetFailure()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!writer.GetFailure()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.GetFailure()"
")"); do { *((volatile int*)__null) = 4271; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4272
4273 UniquePtr<char[]> jsonString = writer.ChunkedWriteFunc().CopyData();
4274 MOZ_RELEASE_ASSERT(jsonString)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(jsonString)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(jsonString))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("jsonString", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4274); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "jsonString"
")"); do { *((volatile int*)__null) = 4274; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4275 std::string_view jsonStringView(jsonString.get());
4276 const size_t length = writer.ChunkedWriteFunc().Length();
4277 MOZ_RELEASE_ASSERT(length == jsonStringView.length())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(length == jsonStringView.length())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(length == jsonStringView.length
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("length == jsonStringView.length()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "length == jsonStringView.length()"
")"); do { *((volatile int*)__null) = 4277; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4278 std::string expected = "{\"data\":[";
4279 expected += aExpectedData;
4280 expected += "],\"stringTable\":[";
4281 expected += aExpectedUniqueStrings;
4282 expected += "]}";
4283 if (jsonStringView != expected) {
4284 fprintf(stderrstderr,
4285 "Expected:\n"
4286 "------\n");
4287 printEscaped(expected);
4288 fprintf(stderrstderr,
4289 "\n"
4290 "------\n"
4291 "Actual:\n"
4292 "------\n");
4293 printEscaped(jsonStringView);
4294 fprintf(stderrstderr,
4295 "\n"
4296 "------\n");
4297 }
4298 MOZ_RELEASE_ASSERT(jsonStringView == expected)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(jsonStringView == expected)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(jsonStringView == expected))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("jsonStringView == expected"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "jsonStringView == expected"
")"); do { *((volatile int*)__null) = 4298; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4299}
4300
4301void TestUniqueJSONStrings() {
4302 printf("TestUniqueJSONStrings...\n");
4303
4304 using SCJW = mozilla::baseprofiler::SpliceableChunkedJSONWriter;
4305 using UJS = mozilla::baseprofiler::UniqueJSONStrings;
4306
4307 // Empty everything.
4308 VerifyUniqueStringContents([](SCJW& aWriter, UJS& aUniqueStrings) {}, "", "");
4309
4310 // Empty unique strings.
4311 VerifyUniqueStringContents(
4312 [](SCJW& aWriter, UJS& aUniqueStrings) {
4313 aWriter.StringElement("string");
4314 },
4315 R"("string")", "");
4316
4317 // One unique string.
4318 VerifyUniqueStringContents(
4319 [](SCJW& aWriter, UJS& aUniqueStrings) {
4320 aUniqueStrings.WriteElement(aWriter, "string");
4321 },
4322 "0", R"("string")");
4323
4324 // One unique string twice.
4325 VerifyUniqueStringContents(
4326 [](SCJW& aWriter, UJS& aUniqueStrings) {
4327 aUniqueStrings.WriteElement(aWriter, "string");
4328 aUniqueStrings.WriteElement(aWriter, "string");
4329 },
4330 "0,0", R"("string")");
4331
4332 // Two single unique strings.
4333 VerifyUniqueStringContents(
4334 [](SCJW& aWriter, UJS& aUniqueStrings) {
4335 aUniqueStrings.WriteElement(aWriter, "string0");
4336 aUniqueStrings.WriteElement(aWriter, "string1");
4337 },
4338 "0,1", R"("string0","string1")");
4339
4340 // Two unique strings with repetition.
4341 VerifyUniqueStringContents(
4342 [](SCJW& aWriter, UJS& aUniqueStrings) {
4343 aUniqueStrings.WriteElement(aWriter, "string0");
4344 aUniqueStrings.WriteElement(aWriter, "string1");
4345 aUniqueStrings.WriteElement(aWriter, "string0");
4346 },
4347 "0,1,0", R"("string0","string1")");
4348
4349 // Mix some object properties, for coverage.
4350 VerifyUniqueStringContents(
4351 [](SCJW& aWriter, UJS& aUniqueStrings) {
4352 aUniqueStrings.WriteElement(aWriter, "string0");
4353 aWriter.StartObjectElement();
4354 {
4355 aUniqueStrings.WriteProperty(aWriter, "p0", "prop");
4356 aUniqueStrings.WriteProperty(aWriter, "p1", "string0");
4357 aUniqueStrings.WriteProperty(aWriter, "p2", "prop");
4358 }
4359 aWriter.EndObject();
4360 aUniqueStrings.WriteElement(aWriter, "string1");
4361 aUniqueStrings.WriteElement(aWriter, "string0");
4362 aUniqueStrings.WriteElement(aWriter, "prop");
4363 },
4364 R"(0,{"p0":1,"p1":0,"p2":1},2,0,1)", R"("string0","prop","string1")");
4365
4366 // Unique string table with pre-existing data.
4367 {
4368 UJS ujs{FailureLatchInfallibleSource::Singleton()};
4369 {
4370 SCJW writer{FailureLatchInfallibleSource::Singleton()};
4371 ujs.WriteElement(writer, "external0");
4372 ujs.WriteElement(writer, "external1");
4373 ujs.WriteElement(writer, "external0");
4374 }
4375 VerifyUniqueStringContents(
4376 [](SCJW& aWriter, UJS& aUniqueStrings) {
4377 aUniqueStrings.WriteElement(aWriter, "string0");
4378 aUniqueStrings.WriteElement(aWriter, "string1");
4379 aUniqueStrings.WriteElement(aWriter, "string0");
4380 },
4381 "2,3,2", R"("external0","external1","string0","string1")", &ujs);
4382 }
4383
4384 // Unique string table with pre-existing data from another table.
4385 {
4386 UJS ujs{FailureLatchInfallibleSource::Singleton()};
4387 {
4388 SCJW writer{FailureLatchInfallibleSource::Singleton()};
4389 ujs.WriteElement(writer, "external0");
4390 ujs.WriteElement(writer, "external1");
4391 ujs.WriteElement(writer, "external0");
4392 }
4393 UJS ujsCopy(FailureLatchInfallibleSource::Singleton(), ujs,
4394 mozilla::ProgressLogger{});
4395 VerifyUniqueStringContents(
4396 [](SCJW& aWriter, UJS& aUniqueStrings) {
4397 aUniqueStrings.WriteElement(aWriter, "string0");
4398 aUniqueStrings.WriteElement(aWriter, "string1");
4399 aUniqueStrings.WriteElement(aWriter, "string0");
4400 },
4401 "2,3,2", R"("external0","external1","string0","string1")", &ujs);
4402 }
4403
4404 // Unique string table through SpliceableJSONWriter.
4405 VerifyUniqueStringContents(
4406 [](SCJW& aWriter, UJS& aUniqueStrings) {
4407 aWriter.SetUniqueStrings(aUniqueStrings);
4408 aWriter.UniqueStringElement("string0");
4409 aWriter.StartObjectElement();
4410 {
4411 aWriter.UniqueStringProperty("p0", "prop");
4412 aWriter.UniqueStringProperty("p1", "string0");
4413 aWriter.UniqueStringProperty("p2", "prop");
4414 }
4415 aWriter.EndObject();
4416 aWriter.UniqueStringElement("string1");
4417 aWriter.UniqueStringElement("string0");
4418 aWriter.UniqueStringElement("prop");
4419 aWriter.ResetUniqueStrings();
4420 },
4421 R"(0,{"p0":1,"p1":0,"p2":1},2,0,1)", R"("string0","prop","string1")");
4422
4423 printf("TestUniqueJSONStrings done\n");
4424}
4425
4426void StreamMarkers(const mozilla::ProfileChunkedBuffer& aBuffer,
4427 mozilla::baseprofiler::SpliceableJSONWriter& aWriter) {
4428 aWriter.StartArrayProperty("data");
4429 {
4430 aBuffer.ReadEach([&](mozilla::ProfileBufferEntryReader& aEntryReader) {
4431 mozilla::ProfileBufferEntryKind entryKind =
4432 aEntryReader.ReadObject<mozilla::ProfileBufferEntryKind>();
4433 MOZ_RELEASE_ASSERT(entryKind == mozilla::ProfileBufferEntryKind::Marker)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(entryKind == mozilla::ProfileBufferEntryKind::Marker
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(entryKind == mozilla::ProfileBufferEntryKind::Marker
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"entryKind == mozilla::ProfileBufferEntryKind::Marker", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4433); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "entryKind == mozilla::ProfileBufferEntryKind::Marker"
")"); do { *((volatile int*)__null) = 4433; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4434
4435 mozilla::base_profiler_markers_detail::DeserializeAfterKindAndStream(
4436 aEntryReader,
4437 [&](const mozilla::baseprofiler::BaseProfilerThreadId&) {
4438 return &aWriter;
4439 },
4440 [&](mozilla::ProfileChunkedBuffer&) {
4441 aWriter.StringElement("Real backtrace would be here");
4442 },
4443 [&](mozilla::base_profiler_markers_detail::Streaming::
4444 DeserializerTag) {});
4445 });
4446 }
4447 aWriter.EndArray();
4448}
4449
4450void PrintMarkers(const mozilla::ProfileChunkedBuffer& aBuffer) {
4451 mozilla::baseprofiler::SpliceableJSONWriter writer(
4452 mozilla::MakeUnique<mozilla::baseprofiler::OStreamJSONWriteFunc>(
4453 std::cout),
4454 FailureLatchInfallibleSource::Singleton());
4455 mozilla::baseprofiler::UniqueJSONStrings uniqueStrings{
4456 FailureLatchInfallibleSource::Singleton()};
4457 writer.SetUniqueStrings(uniqueStrings);
4458 writer.Start();
4459 {
4460 StreamMarkers(aBuffer, writer);
4461
4462 writer.StartArrayProperty("stringTable");
4463 { uniqueStrings.SpliceStringTableElements(writer); }
4464 writer.EndArray();
4465 }
4466 writer.End();
4467 writer.ResetUniqueStrings();
4468}
4469
4470static void SubTestMarkerCategory(
4471 const mozilla::MarkerCategory& aMarkerCategory,
4472 const mozilla::baseprofiler::ProfilingCategoryPair& aProfilingCategoryPair,
4473 const mozilla::baseprofiler::ProfilingCategory& aProfilingCategory) {
4474 MOZ_RELEASE_ASSERT(aMarkerCategory.CategoryPair() == aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aMarkerCategory.CategoryPair() == aProfilingCategoryPair
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aMarkerCategory.CategoryPair() == aProfilingCategoryPair
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aMarkerCategory.CategoryPair() == aProfilingCategoryPair" " ("
"Unexpected MarkerCategory::CategoryPair()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.CategoryPair() == aProfilingCategoryPair"
") (" "Unexpected MarkerCategory::CategoryPair()" ")"); do {
*((volatile int*)__null) = 4475; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
4475 "Unexpected MarkerCategory::CategoryPair()")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aMarkerCategory.CategoryPair() == aProfilingCategoryPair
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aMarkerCategory.CategoryPair() == aProfilingCategoryPair
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aMarkerCategory.CategoryPair() == aProfilingCategoryPair" " ("
"Unexpected MarkerCategory::CategoryPair()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.CategoryPair() == aProfilingCategoryPair"
") (" "Unexpected MarkerCategory::CategoryPair()" ")"); do {
*((volatile int*)__null) = 4475; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
4476
4477 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair
() == aProfilingCategoryPair)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair
).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
" (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
") (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4478 mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair
() == aProfilingCategoryPair)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair
).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
" (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
") (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4479 aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair
() == aProfilingCategoryPair)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair
).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
" (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
") (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4480 "MarkerCategory(<name>).CategoryPair() should return <name>")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair
() == aProfilingCategoryPair)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair
).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
" (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair"
") (" "MarkerCategory(<name>).CategoryPair() should return <name>"
")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4481
4482 MOZ_RELEASE_ASSERT(aMarkerCategory.GetCategory() == aProfilingCategory,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aMarkerCategory.GetCategory() == aProfilingCategory)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aMarkerCategory.GetCategory() == aProfilingCategory)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aMarkerCategory.GetCategory() == aProfilingCategory"
" (" "Unexpected MarkerCategory::GetCategory()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.GetCategory() == aProfilingCategory"
") (" "Unexpected MarkerCategory::GetCategory()" ")"); do { *
((volatile int*)__null) = 4483; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
4483 "Unexpected MarkerCategory::GetCategory()")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aMarkerCategory.GetCategory() == aProfilingCategory)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(aMarkerCategory.GetCategory() == aProfilingCategory)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aMarkerCategory.GetCategory() == aProfilingCategory"
" (" "Unexpected MarkerCategory::GetCategory()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.GetCategory() == aProfilingCategory"
") (" "Unexpected MarkerCategory::GetCategory()" ")"); do { *
((volatile int*)__null) = 4483; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4484
4485 mozilla::ProfileBufferChunkManagerSingle chunkManager(512);
4486 mozilla::ProfileChunkedBuffer buffer(
4487 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
4488 mozilla::ProfileBufferBlockIndex i = buffer.PutObject(aMarkerCategory);
4489 MOZ_RELEASE_ASSERT(i != mozilla::ProfileBufferBlockIndex{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i != mozilla::ProfileBufferBlockIndex{})>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(i != mozilla::ProfileBufferBlockIndex{}))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("i != mozilla::ProfileBufferBlockIndex{}"
" (" "Failed serialization" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4490); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i != mozilla::ProfileBufferBlockIndex{}"
") (" "Failed serialization" ")"); do { *((volatile int*)__null
) = 4490; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
4490 "Failed serialization")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i != mozilla::ProfileBufferBlockIndex{})>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(i != mozilla::ProfileBufferBlockIndex{}))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("i != mozilla::ProfileBufferBlockIndex{}"
" (" "Failed serialization" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4490); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i != mozilla::ProfileBufferBlockIndex{}"
") (" "Failed serialization" ")"); do { *((volatile int*)__null
) = 4490; __attribute__((nomerge)) ::abort(); } while (false)
; } } while (false)
;
4491 buffer.ReadEach([&](mozilla::ProfileBufferEntryReader& aER,
4492 mozilla::ProfileBufferBlockIndex aIndex) {
4493 MOZ_RELEASE_ASSERT(aIndex == i, "Unexpected deserialization index")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aIndex == i)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aIndex == i))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("aIndex == i" " ("
"Unexpected deserialization index" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4493); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aIndex == i"
") (" "Unexpected deserialization index" ")"); do { *((volatile
int*)__null) = 4493; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
4494 const auto readCategory = aER.ReadObject<mozilla::MarkerCategory>();
4495 MOZ_RELEASE_ASSERT(aER.RemainingBytes() == 0,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == 0)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == 0"
" (" "Unexpected extra serialized bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4496); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == 0"
") (" "Unexpected extra serialized bytes" ")"); do { *((volatile
int*)__null) = 4496; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
4496 "Unexpected extra serialized bytes")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aER.RemainingBytes() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == 0)))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == 0"
" (" "Unexpected extra serialized bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4496); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == 0"
") (" "Unexpected extra serialized bytes" ")"); do { *((volatile
int*)__null) = 4496; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
4497 MOZ_RELEASE_ASSERT(readCategory.CategoryPair() == aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(readCategory.CategoryPair() == aProfilingCategoryPair
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(readCategory.CategoryPair() == aProfilingCategoryPair
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"readCategory.CategoryPair() == aProfilingCategoryPair" " (" "Incorrect deserialization value"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4498); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "readCategory.CategoryPair() == aProfilingCategoryPair"
") (" "Incorrect deserialization value" ")"); do { *((volatile
int*)__null) = 4498; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
4498 "Incorrect deserialization value")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(readCategory.CategoryPair() == aProfilingCategoryPair
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(readCategory.CategoryPair() == aProfilingCategoryPair
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"readCategory.CategoryPair() == aProfilingCategoryPair" " (" "Incorrect deserialization value"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4498); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "readCategory.CategoryPair() == aProfilingCategoryPair"
") (" "Incorrect deserialization value" ")"); do { *((volatile
int*)__null) = 4498; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
4499 });
4500}
4501
4502void TestMarkerCategory() {
4503 printf("TestMarkerCategory...\n");
4504
4505 mozilla::ProfileBufferChunkManagerSingle chunkManager(512);
4506 mozilla::ProfileChunkedBuffer buffer(
4507 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
4508
4509# define CATEGORY_ENUM_BEGIN_CATEGORY(name, labelAsString, color)
4510# define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) \
4511 static_assert( \
4512 std::is_same_v<decltype(mozilla::baseprofiler::category::name), \
4513 const mozilla::MarkerCategory>, \
4514 "baseprofiler::category::<name> should be a const MarkerCategory"); \
4515 \
4516 SubTestMarkerCategory( \
4517 mozilla::baseprofiler::category::name, \
4518 mozilla::baseprofiler::ProfilingCategoryPair::name, \
4519 mozilla::baseprofiler::ProfilingCategory::supercategory);
4520# define CATEGORY_ENUM_END_CATEGORY
4521 MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY
(IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER
, "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead
, "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling
, "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST
, "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT
, LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction
, "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow
, "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing
, "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery
, "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation
, "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy
, "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing
, "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS
, "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY
(JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS,
JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline
, "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther
, "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC
, "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue"
) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding,
"Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation
, "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList
, "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding,
"Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID
, "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID
, JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY
(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green"
) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN
, "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY
(IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA
, "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y
, "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY(
PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY
(REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY
(SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TELEMETRY, "Telemetry", "grey") CATEGORY_ENUM_SUBCATEGORY(TELEMETRY
, TELEMETRY, "Other") CATEGORY_ENUM_END_CATEGORY
4522 CATEGORY_ENUM_SUBCATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY
(IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER
, "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead
, "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling
, "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST
, "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT
, LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction
, "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow
, "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing
, "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery
, "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation
, "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy
, "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing
, "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS
, "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY
(JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS,
JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline
, "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther
, "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC
, "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue"
) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding,
"Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation
, "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList
, "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding,
"Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID
, "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID
, JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY
(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green"
) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN
, "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY
(IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA
, "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y
, "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY(
PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY
(REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY
(SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TELEMETRY, "Telemetry", "grey") CATEGORY_ENUM_SUBCATEGORY(TELEMETRY
, TELEMETRY, "Other") CATEGORY_ENUM_END_CATEGORY
4523 CATEGORY_ENUM_END_CATEGORY)CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY
(IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER
, "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead
, "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling
, "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST
, "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT
, LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction
, "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow
, "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing
, "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery
, "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation
, "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy
, "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing
, "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS
, "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)"
) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY
(JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS,
JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline
, "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther
, "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC
, "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray"
) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY
(GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue"
) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding,
"Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation
, "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList
, "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS
, GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY
(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints"
) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding,
"Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID
, "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID
, JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY
(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green"
) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN
, "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY
(JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY
(IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA
, "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback"
) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering"
) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y
, "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY(
PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER
, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY
(REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY
CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY
(SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY
(TELEMETRY, "Telemetry", "grey") CATEGORY_ENUM_SUBCATEGORY(TELEMETRY
, TELEMETRY, "Other") CATEGORY_ENUM_END_CATEGORY
4524# undef CATEGORY_ENUM_BEGIN_CATEGORY
4525# undef CATEGORY_ENUM_SUBCATEGORY
4526# undef CATEGORY_ENUM_END_CATEGORY
4527
4528 printf("TestMarkerCategory done\n");
4529}
4530
4531void TestMarkerThreadId() {
4532 printf("TestMarkerThreadId...\n");
4533
4534 MOZ_RELEASE_ASSERT(MarkerThreadId{}.IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{}.IsUnspecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId{}.IsUnspecified
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId{}.IsUnspecified()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{}.IsUnspecified()"
")"); do { *((volatile int*)__null) = 4534; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4535 MOZ_RELEASE_ASSERT(!MarkerThreadId::MainThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId::MainThread().IsUnspecified())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!MarkerThreadId::MainThread().IsUnspecified()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::MainThread().IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4535); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::MainThread().IsUnspecified()"
")"); do { *((volatile int*)__null) = 4535; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4536 MOZ_RELEASE_ASSERT(!MarkerThreadId::CurrentThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId::CurrentThread().IsUnspecified())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!MarkerThreadId::CurrentThread().IsUnspecified()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::CurrentThread().IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4536); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::CurrentThread().IsUnspecified()"
")"); do { *((volatile int*)__null) = 4536; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4537
4538 MOZ_RELEASE_ASSERT(!MarkerThreadId{do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler
::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4539 mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)}do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler
::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4540 .IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler
::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()"
")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4541 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4542 MarkerThreadId{do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4543 mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)}do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4544 .ThreadId()do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4545 .ToNumber() == 42)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId
::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42"
")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4546
4547 // We'll assume that this test runs in the main thread (which should be true
4548 // when called from the `main` function).
4549 MOZ_RELEASE_ASSERT(MarkerThreadId::MainThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::MainThread().ThreadId() == mozilla::
baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread()
.ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4550; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4550 mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::MainThread().ThreadId() == mozilla::
baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread()
.ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4550; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4551
4552 MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
")"); do { *((volatile int*)__null) = 4553; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4553 mozilla::baseprofiler::profiler_current_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
")"); do { *((volatile int*)__null) = 4553; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4554
4555 MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4556); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4556; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4556 mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4556); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4556; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4557
4558 std::thread testThread([]() {
4559 MOZ_RELEASE_ASSERT(!MarkerThreadId::MainThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId::MainThread().IsUnspecified())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!MarkerThreadId::MainThread().IsUnspecified()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::MainThread().IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::MainThread().IsUnspecified()"
")"); do { *((volatile int*)__null) = 4559; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4560 MOZ_RELEASE_ASSERT(!MarkerThreadId::CurrentThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!MarkerThreadId::CurrentThread().IsUnspecified())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!MarkerThreadId::CurrentThread().IsUnspecified()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::CurrentThread().IsUnspecified()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4560); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::CurrentThread().IsUnspecified()"
")"); do { *((volatile int*)__null) = 4560; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4561
4562 MOZ_RELEASE_ASSERT(MarkerThreadId::MainThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::MainThread().ThreadId() == mozilla::
baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread()
.ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4563); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4563; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4563 mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::MainThread().ThreadId() == mozilla::
baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread()
.ThreadId() == mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4563); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4563; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4564
4565 MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4566); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
")"); do { *((volatile int*)__null) = 4566; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4566 mozilla::baseprofiler::profiler_current_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla
::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4566); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()"
")"); do { *((volatile int*)__null) = 4566; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4567
4568 MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() !=do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() != mozilla
::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4569; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4569 mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(MarkerThreadId::CurrentThread().ThreadId() != mozilla
::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread
().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()"
")"); do { *((volatile int*)__null) = 4569; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4570 });
4571 testThread.join();
4572
4573 printf("TestMarkerThreadId done\n");
4574}
4575
4576void TestMarkerNoPayload() {
4577 printf("TestMarkerNoPayload...\n");
4578
4579 mozilla::ProfileBufferChunkManagerSingle chunkManager(512);
4580 mozilla::ProfileChunkedBuffer buffer(
4581 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
4582
4583 mozilla::ProfileBufferBlockIndex i0 =
4584 mozilla::baseprofiler::AddMarkerToBuffer(
4585 buffer, "literal", mozilla::baseprofiler::category::OTHER_Profiling);
4586 MOZ_RELEASE_ASSERT(i0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i0)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(i0))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("i0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4586); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i0"
")"); do { *((volatile int*)__null) = 4586; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4587
4588 const std::string dynamic = "dynamic";
4589 mozilla::ProfileBufferBlockIndex i1 =
4590 mozilla::baseprofiler::AddMarkerToBuffer(
4591 buffer, dynamic,
4592 mozilla::baseprofiler::category::GRAPHICS_FlushingAsyncPaints, {});
4593 MOZ_RELEASE_ASSERT(i1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i1)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(i1))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("i1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4593); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i1"
")"); do { *((volatile int*)__null) = 4593; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4594 MOZ_RELEASE_ASSERT(i1 > i0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i1 > i0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(i1 > i0))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("i1 > i0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4594); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i1 > i0"
")"); do { *((volatile int*)__null) = 4594; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4595
4596 mozilla::ProfileBufferBlockIndex i2 =
4597 mozilla::baseprofiler::AddMarkerToBuffer(
4598 buffer, std::string_view("string_view"),
4599 mozilla::baseprofiler::category::GRAPHICS_FlushingAsyncPaints, {});
4600 MOZ_RELEASE_ASSERT(i2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i2)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(i2))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("i2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4600); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i2"
")"); do { *((volatile int*)__null) = 4600; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4601 MOZ_RELEASE_ASSERT(i2 > i1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(i2 > i1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(i2 > i1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("i2 > i1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i2 > i1"
")"); do { *((volatile int*)__null) = 4601; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4602
4603# ifdef DEBUG1
4604 buffer.Dump();
4605# endif
4606
4607 PrintMarkers(buffer);
4608
4609 printf("TestMarkerNoPayload done\n");
4610}
4611
4612void TestUserMarker() {
4613 printf("TestUserMarker...\n");
4614
4615 // User-defined marker type with text.
4616 // It's fine to define it right in the function where it's used.
4617 struct MarkerTypeTestMinimal {
4618 static constexpr Span<const char> MarkerTypeName() {
4619 return MakeStringSpan("test-minimal");
4620 }
4621 static void StreamJSONMarkerData(
4622 mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
4623 const std::string& aText) {
4624 aWriter.StringProperty("text", aText);
4625 }
4626 static mozilla::MarkerSchema MarkerTypeDisplay() {
4627 using MS = mozilla::MarkerSchema;
4628 MS schema{MS::Location::MarkerChart, MS::Location::MarkerTable};
4629 schema.SetTooltipLabel("tooltip for test-minimal");
4630 schema.AddKeyLabelFormatSearchable("text", "Text", MS::Format::String,
4631 MS::Searchable::Searchable);
4632 return schema;
4633 }
4634 };
4635
4636 mozilla::ProfileBufferChunkManagerSingle chunkManager(1024);
4637 mozilla::ProfileChunkedBuffer buffer(
4638 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
4639
4640 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal
{}, std::string("payload text")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, {}, MarkerTypeTestMinimal{}, std::string("payload text"))))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4641 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal
{}, std::string("payload text")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, {}, MarkerTypeTestMinimal{}, std::string("payload text"))))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4642 MarkerTypeTestMinimal{}, std::string("payload text")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal
{}, std::string("payload text")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, {}, MarkerTypeTestMinimal{}, std::string("payload text"))))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))"
")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4643
4644 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4645 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4646 mozilla::MarkerThreadId(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4647 mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4648 MarkerTypeTestMinimal{}, std::string("ThreadId(123)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::
FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)"
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))"
")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4649
4650 auto start = mozilla::TimeStamp::Now();
4651
4652 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::
string("InstantAt(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal
{}, std::string("InstantAt(start)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4653 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::
string("InstantAt(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal
{}, std::string("InstantAt(start)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4654 mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::
string("InstantAt(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal
{}, std::string("InstantAt(start)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4655 std::string("InstantAt(start)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::
string("InstantAt(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal
{}, std::string("InstantAt(start)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))"
")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4656
4657 auto then = mozilla::TimeStamp::Now();
4658
4659 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std
::string("IntervalStart(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal
{}, std::string("IntervalStart(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4660 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std
::string("IntervalStart(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal
{}, std::string("IntervalStart(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4661 mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std
::string("IntervalStart(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal
{}, std::string("IntervalStart(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4662 std::string("IntervalStart(start)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std
::string("IntervalStart(start)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal
{}, std::string("IntervalStart(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))"
")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4663
4664 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std
::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal
{}, std::string("IntervalEnd(then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4665 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std
::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal
{}, std::string("IntervalEnd(then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4666 mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std
::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal
{}, std::string("IntervalEnd(then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4667 std::string("IntervalEnd(then)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std
::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal
{}, std::string("IntervalEnd(then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))"
")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4668
4669 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},
std::string("Interval(start, then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal
{}, std::string("Interval(start, then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4670 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},
std::string("Interval(start, then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal
{}, std::string("Interval(start, then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4671 mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},
std::string("Interval(start, then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal
{}, std::string("Interval(start, then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4672 std::string("Interval(start, then)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},
std::string("Interval(start, then)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal
{}, std::string("Interval(start, then)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))"
")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4673
4674 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal
{}, std::string("IntervalUntilNowFrom(start)")))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2",
mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming
::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::
string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4675 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal
{}, std::string("IntervalUntilNowFrom(start)")))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2",
mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming
::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::
string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4676 mozilla::MarkerTiming::IntervalUntilNowFrom(start),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal
{}, std::string("IntervalUntilNowFrom(start)")))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2",
mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming
::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::
string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4677 MarkerTypeTestMinimal{}, std::string("IntervalUntilNowFrom(start)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal
{}, std::string("IntervalUntilNowFrom(start)")))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2",
mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming
::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::
string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))"
")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4678
4679 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(
"NoStack")))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std
::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4680 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(
"NoStack")))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std
::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4681 mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(
"NoStack")))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std
::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4682 std::string("NoStack")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(
"NoStack")))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std
::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))"
")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4683 // Note: We cannot test stack-capture here, because the profiler is not
4684 // initialized.
4685
4686 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string
("InnerWindowId(123)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},
std::string("InnerWindowId(123)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4687 buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string
("InnerWindowId(123)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},
std::string("InnerWindowId(123)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4688 mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string
("InnerWindowId(123)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},
std::string("InnerWindowId(123)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4689 std::string("InnerWindowId(123)")))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2"
, mozilla::baseprofiler::category::OTHER_Profiling, mozilla::
MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string
("InnerWindowId(123)")))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling
, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},
std::string("InnerWindowId(123)"))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))"
")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4690
4691# ifdef DEBUG1
4692 buffer.Dump();
4693# endif
4694
4695 PrintMarkers(buffer);
4696
4697 printf("TestUserMarker done\n");
4698}
4699
4700void TestPredefinedMarkers() {
4701 printf("TestPredefinedMarkers...\n");
4702
4703 mozilla::ProfileBufferChunkManagerSingle chunkManager(1024);
4704 mozilla::ProfileChunkedBuffer buffer(
4705 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager);
4706
4707 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4708 buffer, std::string_view("tracing"),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4709 mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4710 mozilla::baseprofiler::markers::Tracing{}, "category"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("tracing"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::Tracing{}, "category"))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")"
")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4711
4712 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4713 buffer, std::string_view("text"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4714 {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("text"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")"
")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4715
4716 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123
, 456, 789))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4717 buffer, std::string_view("media"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123
, 456, 789))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4718 {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123
, 456, 789))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker
{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)"
")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4719
4720 MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4721 buffer, std::string_view("media"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4722 {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4723 456))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std
::string_view("media"), mozilla::baseprofiler::category::OTHER
, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer
( buffer, std::string_view("media"), mozilla::baseprofiler::category
::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker
{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)"
")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4724
4725# ifdef DEBUG1
4726 buffer.Dump();
4727# endif
4728
4729 PrintMarkers(buffer);
4730
4731 printf("TestPredefinedMarkers done\n");
4732}
4733
4734void TestProfilerMarkers() {
4735 printf(
4736 "TestProfilerMarkers -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n",
4737 uint64_t(mozilla::baseprofiler::profiler_current_process_id().ToNumber()),
4738 uint64_t(mozilla::baseprofiler::profiler_current_thread_id().ToNumber()));
4739 // ::SleepMilli(10000);
4740
4741 TestUniqueJSONStrings();
4742 TestMarkerCategory();
4743 TestMarkerThreadId();
4744 TestMarkerNoPayload();
4745 TestUserMarker();
4746 TestPredefinedMarkers();
4747
4748 printf("TestProfilerMarkers done\n");
4749}
4750
4751#else // MOZ_GECKO_PROFILER
4752
4753// Testing that macros are still #defined (but do nothing) when
4754// MOZ_GECKO_PROFILER is disabled.
4755void TestProfiler() {
4756 // These don't need to make sense, we just want to know that they're defined
4757 // and don't do anything.
4758
4759# ifndef AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4759
4760# error AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4760 not #defined
4761# endif // AUTO_BASE_PROFILER_INIT
4762 AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4762;
4763
4764# ifndef AUTO_BASE_PROFILER_MARKER_TEXT
4765# error AUTO_BASE_PROFILER_MARKER_TEXT not #defined
4766# endif // AUTO_BASE_PROFILER_MARKER_TEXT
4767
4768# ifndef AUTO_BASE_PROFILER_LABEL
4769# error AUTO_BASE_PROFILER_LABEL not #defined
4770# endif // AUTO_BASE_PROFILER_LABEL
4771
4772# ifndef AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4772
4773# error AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4773 not #defined
4774# endif // AUTO_BASE_PROFILER_THREAD_SLEEP
4775 AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4775;
4776
4777# ifndef BASE_PROFILER_MARKER_UNTYPED
4778# error BASE_PROFILER_MARKER_UNTYPED not #defined
4779# endif // BASE_PROFILER_MARKER_UNTYPED
4780
4781# ifndef BASE_PROFILER_MARKER
4782# error BASE_PROFILER_MARKER not #defined
4783# endif // BASE_PROFILER_MARKER
4784
4785# ifndef BASE_PROFILER_MARKER_TEXT
4786# error BASE_PROFILER_MARKER_TEXT not #defined
4787# endif // BASE_PROFILER_MARKER_TEXT
4788
4789 MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_get_backtrace(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_get_backtrace())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_get_backtrace()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_get_backtrace()"
" (" "profiler_get_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_get_backtrace()"
") (" "profiler_get_backtrace should return nullptr" ")"); do
{ *((volatile int*)__null) = 4790; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
4790 "profiler_get_backtrace should return nullptr")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_get_backtrace())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_get_backtrace()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_get_backtrace()"
" (" "profiler_get_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_get_backtrace()"
") (" "profiler_get_backtrace should return nullptr" ")"); do
{ *((volatile int*)__null) = 4790; __attribute__((nomerge)) ::
abort(); } while (false); } } while (false)
;
4791 mozilla::ProfileChunkedBuffer buffer(
4792 mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex);
4793 MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_capture_backtrace_into(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
" (" "profiler_capture_backtrace_into should return false" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
") (" "profiler_capture_backtrace_into should return false" ")"
); do { *((volatile int*)__null) = 4795; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4794 buffer, mozilla::StackCaptureOptions::Full),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
" (" "profiler_capture_backtrace_into should return false" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
") (" "profiler_capture_backtrace_into should return false" ")"
); do { *((volatile int*)__null) = 4795; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4795 "profiler_capture_backtrace_into should return false")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into
( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
" (" "profiler_capture_backtrace_into should return false" ")"
, "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)"
") (" "profiler_capture_backtrace_into should return false" ")"
); do { *((volatile int*)__null) = 4795; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4796 MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_capture_backtrace(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_capture_backtrace()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!mozilla::baseprofiler::profiler_capture_backtrace()" " (" "profiler_capture_backtrace should return nullptr"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4797); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace()"
") (" "profiler_capture_backtrace should return nullptr" ")"
); do { *((volatile int*)__null) = 4797; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4797 "profiler_capture_backtrace should return nullptr")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!mozilla::baseprofiler::profiler_capture_backtrace()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!mozilla::baseprofiler::profiler_capture_backtrace()" " (" "profiler_capture_backtrace should return nullptr"
")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp"
, 4797); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace()"
") (" "profiler_capture_backtrace should return nullptr" ")"
); do { *((volatile int*)__null) = 4797; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4798}
4799
4800// Testing that macros are still #defined (but do nothing) when
4801// MOZ_GECKO_PROFILER is disabled.
4802void TestProfilerMarkers() {
4803 // These don't need to make sense, we just want to know that they're defined
4804 // and don't do anything.
4805}
4806
4807#endif // MOZ_GECKO_PROFILER else
4808
4809#if defined(XP_WIN)
4810int wmain()
4811#else
4812int main()
4813#endif // defined(XP_WIN)
4814{
4815#ifdef MOZ_GECKO_PROFILER1
4816 printf("BaseTestProfiler -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n",
4817 uint64_t(baseprofiler::profiler_current_process_id().ToNumber()),
4818 uint64_t(baseprofiler::profiler_current_thread_id().ToNumber()));
4819 // ::SleepMilli(10000);
4820#endif // MOZ_GECKO_PROFILER
4821
4822 TestFailureLatch();
4823 TestProfilerUtils();
4824 TestBaseAndProfilerDetail();
4825 TestSharedMutex();
4826 TestProportionValue();
4827 TestProgressLogger();
4828 // Note that there are two `TestProfiler{,Markers}` functions above, depending
4829 // on whether MOZ_GECKO_PROFILER is #defined.
4830 {
4831 printf("profiler_init()...\n");
4832 AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4832;
4833
4834 TestProfiler();
4835 TestProfilerMarkers();
4836 }
4837
4838 return 0;
4839}

/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h

1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7/* A class for optional values and in-place lazy construction. */
8
9#ifndef mozilla_Maybe_h
10#define mozilla_Maybe_h
11
12#include <functional>
13#include <new> // for placement new
14#include <ostream>
15#include <type_traits>
16#include <utility>
17
18#include "mozilla/Alignment.h"
19#include "mozilla/Assertions.h"
20#include "mozilla/Attributes.h"
21#include "mozilla/MaybeStorageBase.h"
22#include "mozilla/MemoryChecking.h"
23#include "mozilla/OperatorNewExtensions.h"
24#include "mozilla/Poison.h"
25#include "mozilla/ThreadSafety.h"
26
27class nsCycleCollectionTraversalCallback;
28
29template <typename T>
30inline void CycleCollectionNoteChild(
31 nsCycleCollectionTraversalCallback& aCallback, T* aChild, const char* aName,
32 uint32_t aFlags);
33
34namespace mozilla {
35
36struct Nothing {};
37
38inline constexpr bool operator==(const Nothing&, const Nothing&) {
39 return true;
40}
41
42template <class T>
43class Maybe;
44
45namespace detail {
46
47// You would think that poisoning Maybe instances could just be a call
48// to mozWritePoison. Unfortunately, using a simple call to
49// mozWritePoison generates poor code on MSVC for small structures. The
50// generated code contains (always not-taken) branches and does a bunch
51// of setup for `rep stos{l,q}`, even though we know at compile time
52// exactly how many words we're poisoning. Instead, we're going to
53// force MSVC to generate the code we want via recursive templates.
54
55// Write the given poisonValue into p at offset*sizeof(uintptr_t).
56template <size_t offset>
57inline void WritePoisonAtOffset(void* p, const uintptr_t poisonValue) {
58 memcpy(static_cast<char*>(p) + offset * sizeof(poisonValue), &poisonValue,
59 sizeof(poisonValue));
60}
61
62template <size_t Offset, size_t NOffsets>
63struct InlinePoisoner {
64 static void poison(void* p, const uintptr_t poisonValue) {
65 WritePoisonAtOffset<Offset>(p, poisonValue);
66 InlinePoisoner<Offset + 1, NOffsets>::poison(p, poisonValue);
67 }
68};
69
70template <size_t N>
71struct InlinePoisoner<N, N> {
72 static void poison(void*, const uintptr_t) {
73 // All done!
74 }
75};
76
77// We can't generate inline code for large structures, though, because we'll
78// blow out recursive template instantiation limits, and the code would be
79// bloated to boot. So provide a fallback to the out-of-line poisoner.
80template <size_t ObjectSize>
81struct OutOfLinePoisoner {
82 static MOZ_NEVER_INLINE__attribute__((noinline)) void poison(void* p, const uintptr_t) {
83 mozWritePoison(p, ObjectSize);
84 }
85};
86
87template <typename T>
88inline void PoisonObject(T* p) {
89 const uintptr_t POISON = mozPoisonValue();
90 std::conditional_t<(sizeof(T) <= 8 * sizeof(POISON)),
91 InlinePoisoner<0, sizeof(T) / sizeof(POISON)>,
92 OutOfLinePoisoner<sizeof(T)>>::poison(p, POISON);
93}
94
95template <typename T>
96struct MaybePoisoner {
97 static const size_t N = sizeof(T);
98
99 static void poison(void* aPtr) {
100#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED1
101 if (N >= sizeof(uintptr_t)) {
102 PoisonObject(static_cast<std::remove_cv_t<T>*>(aPtr));
103 }
104#endif
105 MOZ_MAKE_MEM_UNDEFINED(aPtr, N)do { } while (0);
106 }
107};
108
109template <typename T,
110 bool TriviallyDestructibleAndCopyable =
111 IsTriviallyDestructibleAndCopyable<T>,
112 bool Copyable = std::is_copy_constructible_v<T>,
113 bool Movable = std::is_move_constructible_v<T>>
114class Maybe_CopyMove_Enabler;
115
116#define MOZ_MAYBE_COPY_OPS() \
117 Maybe_CopyMove_Enabler(const Maybe_CopyMove_Enabler& aOther) { \
118 if (downcast(aOther).isSome()) { \
119 downcast(*this).emplace(*downcast(aOther)); \
120 } \
121 } \
122 \
123 Maybe_CopyMove_Enabler& operator=(const Maybe_CopyMove_Enabler& aOther) { \
124 return downcast(*this).template operator= <T>(downcast(aOther)); \
125 }
126
127#define MOZ_MAYBE_MOVE_OPS() \
128 constexpr Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&& aOther) { \
129 if (downcast(aOther).isSome()) { \
130 downcast(*this).emplace(std::move(*downcast(aOther))); \
131 downcast(aOther).reset(); \
132 } \
133 } \
134 \
135 constexpr Maybe_CopyMove_Enabler& operator=( \
136 Maybe_CopyMove_Enabler&& aOther) { \
137 downcast(*this).template operator= <T>(std::move(downcast(aOther))); \
138 \
139 return *this; \
140 }
141
142#define MOZ_MAYBE_DOWNCAST() \
143 static constexpr Maybe<T>& downcast(Maybe_CopyMove_Enabler& aObj) { \
144 return static_cast<Maybe<T>&>(aObj); \
145 } \
146 static constexpr const Maybe<T>& downcast( \
147 const Maybe_CopyMove_Enabler& aObj) { \
148 return static_cast<const Maybe<T>&>(aObj); \
149 }
150
151template <typename T>
152class Maybe_CopyMove_Enabler<T, true, true, true> {
153 public:
154 Maybe_CopyMove_Enabler() = default;
155
156 Maybe_CopyMove_Enabler(const Maybe_CopyMove_Enabler&) = default;
157 Maybe_CopyMove_Enabler& operator=(const Maybe_CopyMove_Enabler&) = default;
158 constexpr Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&& aOther) {
159 downcast(aOther).reset();
160 }
161 constexpr Maybe_CopyMove_Enabler& operator=(Maybe_CopyMove_Enabler&& aOther) {
162 downcast(aOther).reset();
163 return *this;
164 }
165
166 private:
167 MOZ_MAYBE_DOWNCAST()
168};
169
170template <typename T>
171class Maybe_CopyMove_Enabler<T, true, false, true> {
172 public:
173 Maybe_CopyMove_Enabler() = default;
174
175 Maybe_CopyMove_Enabler(const Maybe_CopyMove_Enabler&) = delete;
176 Maybe_CopyMove_Enabler& operator=(const Maybe_CopyMove_Enabler&) = delete;
177 constexpr Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&& aOther) {
178 downcast(aOther).reset();
179 }
180 constexpr Maybe_CopyMove_Enabler& operator=(Maybe_CopyMove_Enabler&& aOther) {
181 downcast(aOther).reset();
182 return *this;
183 }
184
185 private:
186 MOZ_MAYBE_DOWNCAST()
187};
188
189template <typename T>
190class Maybe_CopyMove_Enabler<T, false, true, true> {
191 public:
192 Maybe_CopyMove_Enabler() = default;
193
194 MOZ_MAYBE_COPY_OPS()
195 MOZ_MAYBE_MOVE_OPS()
196
197 private:
198 MOZ_MAYBE_DOWNCAST()
199};
200
201template <typename T>
202class Maybe_CopyMove_Enabler<T, false, false, true> {
203 public:
204 Maybe_CopyMove_Enabler() = default;
205
206 Maybe_CopyMove_Enabler(const Maybe_CopyMove_Enabler&) = delete;
207 Maybe_CopyMove_Enabler& operator=(const Maybe_CopyMove_Enabler&) = delete;
208 MOZ_MAYBE_MOVE_OPS()
209
210 private:
211 MOZ_MAYBE_DOWNCAST()
212};
213
214template <typename T>
215class Maybe_CopyMove_Enabler<T, false, true, false> {
216 public:
217 Maybe_CopyMove_Enabler() = default;
218
219 MOZ_MAYBE_COPY_OPS()
220 Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&&) = delete;
221 Maybe_CopyMove_Enabler& operator=(Maybe_CopyMove_Enabler&&) = delete;
222
223 private:
224 MOZ_MAYBE_DOWNCAST()
225};
226
227template <typename T, bool TriviallyDestructibleAndCopyable>
228class Maybe_CopyMove_Enabler<T, TriviallyDestructibleAndCopyable, false,
229 false> {
230 public:
231 Maybe_CopyMove_Enabler() = default;
232
233 Maybe_CopyMove_Enabler(const Maybe_CopyMove_Enabler&) = delete;
234 Maybe_CopyMove_Enabler& operator=(const Maybe_CopyMove_Enabler&) = delete;
235 Maybe_CopyMove_Enabler(Maybe_CopyMove_Enabler&&) = delete;
236 Maybe_CopyMove_Enabler& operator=(Maybe_CopyMove_Enabler&&) = delete;
237};
238
239#undef MOZ_MAYBE_COPY_OPS
240#undef MOZ_MAYBE_MOVE_OPS
241#undef MOZ_MAYBE_DOWNCAST
242
243template <typename T, bool TriviallyDestructibleAndCopyable =
244 IsTriviallyDestructibleAndCopyable<T>>
245struct MaybeStorage;
246
247template <typename T>
248struct MaybeStorage<T, false> : MaybeStorageBase<T> {
249 protected:
250 char mIsSome = false; // not bool -- guarantees minimal space consumption
251
252 MaybeStorage() = default;
3
Calling defaulted default constructor for 'MaybeStorageBase<mozilla::baseprofiler::AutoProfilerLabel, false>'
8
Returning from default constructor for 'MaybeStorageBase<mozilla::baseprofiler::AutoProfilerLabel, false>'
9
Returning without writing to 'this->mStorage.val.mProfilingStack'
253 explicit MaybeStorage(const T& aVal)
254 : MaybeStorageBase<T>{aVal}, mIsSome{true} {}
255 explicit MaybeStorage(T&& aVal)
256 : MaybeStorageBase<T>{std::move(aVal)}, mIsSome{true} {}
257
258 template <typename... Args>
259 explicit MaybeStorage(std::in_place_t, Args&&... aArgs)
260 : MaybeStorageBase<T>{std::in_place, std::forward<Args>(aArgs)...},
261 mIsSome{true} {}
262
263 public:
264 // Copy and move operations are no-ops, since copying is moving is implemented
265 // by Maybe_CopyMove_Enabler.
266
267 MaybeStorage(const MaybeStorage&) : MaybeStorageBase<T>{} {}
268 MaybeStorage& operator=(const MaybeStorage&) { return *this; }
269 MaybeStorage(MaybeStorage&&) : MaybeStorageBase<T>{} {}
270 MaybeStorage& operator=(MaybeStorage&&) { return *this; }
271
272 ~MaybeStorage() {
273 if (mIsSome
18.1
Field 'mIsSome' is 0
18.1
Field 'mIsSome' is 0
18.1
Field 'mIsSome' is 0
18.1
Field 'mIsSome' is 0
) {
19
Taking false branch
274 this->addr()->T::~T();
275 }
276 }
20
Calling implicit destructor for 'MaybeStorageBase<mozilla::baseprofiler::AutoProfilerLabel, false>'
21
Calling '~Union'
277};
278
279template <typename T>
280struct MaybeStorage<T, true> : MaybeStorageBase<T> {
281 protected:
282 char mIsSome = false; // not bool -- guarantees minimal space consumption
283
284 constexpr MaybeStorage() = default;
285 constexpr explicit MaybeStorage(const T& aVal)
286 : MaybeStorageBase<T>{aVal}, mIsSome{true} {}
287 constexpr explicit MaybeStorage(T&& aVal)
288 : MaybeStorageBase<T>{std::move(aVal)}, mIsSome{true} {}
289
290 template <typename... Args>
291 constexpr explicit MaybeStorage(std::in_place_t, Args&&... aArgs)
292 : MaybeStorageBase<T>{std::in_place, std::forward<Args>(aArgs)...},
293 mIsSome{true} {}
294};
295
296template <typename T>
297struct IsMaybeImpl : std::false_type {};
298
299template <typename T>
300struct IsMaybeImpl<Maybe<T>> : std::true_type {};
301
302template <typename T>
303using IsMaybe = IsMaybeImpl<std::decay_t<T>>;
304
305} // namespace detail
306
307template <typename T, typename U = typename std::remove_cv<
308 typename std::remove_reference<T>::type>::type>
309constexpr Maybe<U> Some(T&& aValue);
310
311/*
312 * Maybe is a container class which contains either zero or one elements. It
313 * serves two roles. It can represent values which are *semantically* optional,
314 * augmenting a type with an explicit 'Nothing' value. In this role, it provides
315 * methods that make it easy to work with values that may be missing, along with
316 * equality and comparison operators so that Maybe values can be stored in
317 * containers. Maybe values can be constructed conveniently in expressions using
318 * type inference, as follows:
319 *
320 * void doSomething(Maybe<Foo> aFoo) {
321 * if (aFoo) // Make sure that aFoo contains a value...
322 * aFoo->takeAction(); // and then use |aFoo->| to access it.
323 * } // |*aFoo| also works!
324 *
325 * doSomething(Nothing()); // Passes a Maybe<Foo> containing no value.
326 * doSomething(Some(Foo(100))); // Passes a Maybe<Foo> containing |Foo(100)|.
327 *
328 * You'll note that it's important to check whether a Maybe contains a value
329 * before using it, using conversion to bool, |isSome()|, or |isNothing()|. You
330 * can avoid these checks, and sometimes write more readable code, using
331 * |valueOr()|, |ptrOr()|, and |refOr()|, which allow you to retrieve the value
332 * in the Maybe and provide a default for the 'Nothing' case. You can also use
333 * |apply()| to call a function only if the Maybe holds a value, and |map()| to
334 * transform the value in the Maybe, returning another Maybe with a possibly
335 * different type.
336 *
337 * Maybe's other role is to support lazily constructing objects without using
338 * dynamic storage. A Maybe directly contains storage for a value, but it's
339 * empty by default. |emplace()|, as mentioned above, can be used to construct a
340 * value in Maybe's storage. The value a Maybe contains can be destroyed by
341 * calling |reset()|; this will happen automatically if a Maybe is destroyed
342 * while holding a value.
343 *
344 * It's a common idiom in C++ to use a pointer as a 'Maybe' type, with a null
345 * value meaning 'Nothing' and any other value meaning 'Some'. You can convert
346 * from such a pointer to a Maybe value using 'ToMaybe()'.
347 *
348 * Maybe is inspired by similar types in the standard library of many other
349 * languages (e.g. Haskell's Maybe and Rust's Option). In the C++ world it's
350 * very similar to std::optional, which was proposed for C++14 and originated in
351 * Boost. The most important differences between Maybe and std::optional are:
352 *
353 * - std::optional<T> may be compared with T. We deliberately forbid that.
354 * - std::optional has |valueOr()|, equivalent to Maybe's |valueOr()|, but
355 * lacks corresponding methods for |refOr()| and |ptrOr()|.
356 * - std::optional lacks |map()| and |apply()|, making it less suitable for
357 * functional-style code.
358 * - std::optional lacks many convenience functions that Maybe has. Most
359 * unfortunately, it lacks equivalents of the type-inferred constructor
360 * functions |Some()| and |Nothing()|.
361 */
362template <class T>
363class MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS Maybe
364 : private detail::MaybeStorage<T>,
365 public detail::Maybe_CopyMove_Enabler<T> {
366 template <typename, bool, bool, bool>
367 friend class detail::Maybe_CopyMove_Enabler;
368
369 template <typename U, typename V>
370 friend constexpr Maybe<V> Some(U&& aValue);
371
372 struct SomeGuard {};
373
374 template <typename U>
375 constexpr Maybe(U&& aValue, SomeGuard)
376 : detail::MaybeStorage<T>{std::forward<U>(aValue)} {}
377
378 using detail::MaybeStorage<T>::mIsSome;
379 using detail::MaybeStorage<T>::mStorage;
380
381 void poisonData() { detail::MaybePoisoner<T>::poison(&mStorage.val); }
382
383 public:
384 using ValueType = T;
385
386 MOZ_ALLOW_TEMPORARY constexpr Maybe() = default;
2
Calling defaulted default constructor for 'MaybeStorage<mozilla::baseprofiler::AutoProfilerLabel, false>'
10
Returning from default constructor for 'MaybeStorage<mozilla::baseprofiler::AutoProfilerLabel, false>'
11
Returning without writing to 'this->mStorage.val.mProfilingStack'
387
388 MOZ_ALLOW_TEMPORARY MOZ_IMPLICIT constexpr Maybe(Nothing) : Maybe{} {}
389
390 template <typename... Args>
391 constexpr explicit Maybe(std::in_place_t, Args&&... aArgs)
392 : detail::MaybeStorage<T>{std::in_place, std::forward<Args>(aArgs)...} {}
393
394 /**
395 * Maybe<T> can be copy-constructed from a Maybe<U> if T is constructible from
396 * a const U&.
397 */
398 template <typename U,
399 std::enable_if_t<std::is_constructible_v<T, const U&>, bool> = true>
400 MOZ_IMPLICIT Maybe(const Maybe<U>& aOther) {
401 if (aOther.isSome()) {
402 emplace(*aOther);
403 }
404 }
405
406 template <typename U, std::enable_if_t<!std::is_constructible_v<T, const U&>,
407 bool> = true>
408 explicit Maybe(const Maybe<U>& aOther) = delete;
409
410 /**
411 * Maybe<T> can be move-constructed from a Maybe<U> if T is constructible from
412 * a U&&.
413 */
414 template <typename U,
415 std::enable_if_t<std::is_constructible_v<T, U&&>, bool> = true>
416 MOZ_IMPLICIT Maybe(Maybe<U>&& aOther) {
417 if (aOther.isSome()) {
418 emplace(std::move(*aOther));
419 aOther.reset();
420 }
421 }
422 template <typename U,
423 std::enable_if_t<!std::is_constructible_v<T, U&&>, bool> = true>
424 explicit Maybe(Maybe<U>&& aOther) = delete;
425
426 template <typename U,
427 std::enable_if_t<std::is_constructible_v<T, const U&>, bool> = true>
428 Maybe& operator=(const Maybe<U>& aOther) {
429 if (aOther.isSome()) {
430 if (mIsSome) {
431 ref() = aOther.ref();
432 } else {
433 emplace(*aOther);
434 }
435 } else {
436 reset();
437 }
438 return *this;
439 }
440
441 template <typename U, std::enable_if_t<!std::is_constructible_v<T, const U&>,
442 bool> = true>
443 Maybe& operator=(const Maybe<U>& aOther) = delete;
444
445 template <typename U,
446 std::enable_if_t<std::is_constructible_v<T, U&&>, bool> = true>
447 Maybe& operator=(Maybe<U>&& aOther) {
448 if (aOther.isSome()) {
449 if (mIsSome) {
450 ref() = std::move(aOther.ref());
451 } else {
452 emplace(std::move(*aOther));
453 }
454 aOther.reset();
455 } else {
456 reset();
457 }
458
459 return *this;
460 }
461
462 template <typename U,
463 std::enable_if_t<!std::is_constructible_v<T, U&&>, bool> = true>
464 Maybe& operator=(Maybe<U>&& aOther) = delete;
465
466 constexpr Maybe& operator=(Nothing) {
467 reset();
468 return *this;
469 }
470
471 /* Methods that check whether this Maybe contains a value */
472 constexpr explicit operator bool() const { return isSome(); }
473 constexpr bool isSome() const { return mIsSome; }
474 constexpr bool isNothing() const { return !mIsSome; }
475
476 /* Returns the contents of this Maybe<T> by value. Unsafe unless |isSome()|.
477 */
478 constexpr T value() const&;
479 constexpr T value() &&;
480 constexpr T value() const&&;
481
482 /**
483 * Move the contents of this Maybe<T> out of internal storage and return it
484 * without calling the destructor. The internal storage is also reset to
485 * avoid multiple calls. Unsafe unless |isSome()|.
486 */
487 constexpr T extract() {
488 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 488); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 488; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
489 T v = std::move(mStorage.val);
490 reset();
491 return v;
492 }
493
494 /**
495 * Returns the value (possibly |Nothing()|) by moving it out of this Maybe<T>
496 * and leaving |Nothing()| in its place.
497 */
498 Maybe<T> take() { return std::exchange(*this, Nothing()); }
499
500 /*
501 * Returns the contents of this Maybe<T> by value. If |isNothing()|, returns
502 * the default value provided.
503 *
504 * Note: If the value passed to aDefault is not the result of a trivial
505 * expression, but expensive to evaluate, e.g. |valueOr(ExpensiveFunction())|,
506 * use |valueOrFrom| instead, e.g.
507 * |valueOrFrom([arg] { return ExpensiveFunction(arg); })|. This ensures
508 * that the expensive expression is only evaluated when its result will
509 * actually be used.
510 */
511 template <typename V>
512 constexpr T valueOr(V&& aDefault) const {
513 if (isSome()) {
514 return ref();
515 }
516 return std::forward<V>(aDefault);
517 }
518
519 /*
520 * Returns the contents of this Maybe<T> by value. If |isNothing()|, returns
521 * the value returned from the function or functor provided.
522 */
523 template <typename F>
524 constexpr T valueOrFrom(F&& aFunc) const {
525 if (isSome()) {
526 return ref();
527 }
528 return aFunc();
529 }
530
531 /* Returns the contents of this Maybe<T> by pointer. Unsafe unless |isSome()|.
532 */
533 T* ptr();
534 constexpr const T* ptr() const;
535
536 /*
537 * Returns the contents of this Maybe<T> by pointer. If |isNothing()|,
538 * returns the default value provided.
539 */
540 T* ptrOr(T* aDefault) {
541 if (isSome()) {
542 return ptr();
543 }
544 return aDefault;
545 }
546
547 constexpr const T* ptrOr(const T* aDefault) const {
548 if (isSome()) {
549 return ptr();
550 }
551 return aDefault;
552 }
553
554 /*
555 * Returns the contents of this Maybe<T> by pointer. If |isNothing()|,
556 * returns the value returned from the function or functor provided.
557 */
558 template <typename F>
559 T* ptrOrFrom(F&& aFunc) {
560 if (isSome()) {
561 return ptr();
562 }
563 return aFunc();
564 }
565
566 template <typename F>
567 const T* ptrOrFrom(F&& aFunc) const {
568 if (isSome()) {
569 return ptr();
570 }
571 return aFunc();
572 }
573
574 constexpr T* operator->();
575 constexpr const T* operator->() const;
576
577 /* Returns the contents of this Maybe<T> by ref. Unsafe unless |isSome()|. */
578 constexpr T& ref() &;
579 constexpr const T& ref() const&;
580 constexpr T&& ref() &&;
581 constexpr const T&& ref() const&&;
582
583 /*
584 * Returns the contents of this Maybe<T> by ref. If |isNothing()|, returns
585 * the default value provided.
586 */
587 constexpr T& refOr(T& aDefault) {
588 if (isSome()) {
589 return ref();
590 }
591 return aDefault;
592 }
593
594 constexpr const T& refOr(const T& aDefault) const {
595 if (isSome()) {
596 return ref();
597 }
598 return aDefault;
599 }
600
601 /*
602 * Returns the contents of this Maybe<T> by ref. If |isNothing()|, returns the
603 * value returned from the function or functor provided.
604 */
605 template <typename F>
606 constexpr T& refOrFrom(F&& aFunc) {
607 if (isSome()) {
608 return ref();
609 }
610 return aFunc();
611 }
612
613 template <typename F>
614 constexpr const T& refOrFrom(F&& aFunc) const {
615 if (isSome()) {
616 return ref();
617 }
618 return aFunc();
619 }
620
621 constexpr T& operator*() &;
622 constexpr const T& operator*() const&;
623 constexpr T&& operator*() &&;
624 constexpr const T&& operator*() const&&;
625
626 /* If |isSome()|, runs the provided function or functor on the contents of
627 * this Maybe. */
628 template <typename Func>
629 constexpr Maybe& apply(Func&& aFunc) & {
630 if (isSome()) {
631 std::forward<Func>(aFunc)(ref());
632 }
633 return *this;
634 }
635
636 template <typename Func>
637 constexpr const Maybe& apply(Func&& aFunc) const& {
638 if (isSome()) {
639 std::forward<Func>(aFunc)(ref());
640 }
641 return *this;
642 }
643
644 template <typename Func>
645 constexpr Maybe& apply(Func&& aFunc) && {
646 if (isSome()) {
647 std::forward<Func>(aFunc)(extract());
648 }
649 return *this;
650 }
651
652 template <typename Func>
653 constexpr Maybe& apply(Func&& aFunc) const&& {
654 if (isSome()) {
655 std::forward<Func>(aFunc)(extract());
656 }
657 return *this;
658 }
659
660 /*
661 * If |isSome()|, runs the provided function and returns the result wrapped
662 * in a Maybe. If |isNothing()|, returns an empty Maybe value with the same
663 * value type as what the provided function would have returned.
664 */
665 template <typename Func>
666 constexpr auto map(Func&& aFunc) & {
667 if (isSome()) {
668 return Some(std::forward<Func>(aFunc)(ref()));
669 }
670 return Maybe<decltype(std::forward<Func>(aFunc)(ref()))>{};
671 }
672
673 template <typename Func>
674 constexpr auto map(Func&& aFunc) const& {
675 if (isSome()) {
676 return Some(std::forward<Func>(aFunc)(ref()));
677 }
678 return Maybe<decltype(std::forward<Func>(aFunc)(ref()))>{};
679 }
680
681 template <typename Func>
682 constexpr auto map(Func&& aFunc) && {
683 if (isSome()) {
684 return Some(std::forward<Func>(aFunc)(extract()));
685 }
686 return Maybe<decltype(std::forward<Func>(aFunc)(extract()))>{};
687 }
688
689 template <typename Func>
690 constexpr auto map(Func&& aFunc) const&& {
691 if (isSome()) {
692 return Some(std::forward<Func>(aFunc)(extract()));
693 }
694 return Maybe<decltype(std::forward<Func>(aFunc)(extract()))>{};
695 }
696
697 /*
698 * If |isSome()|, runs the provided function or functor on the contents of
699 * this Maybe and returns the result. Note that the provided function or
700 * functor must return a Maybe<U> of any type U.
701 * If |isNothing()|, returns an empty Maybe value with the same type as what
702 * the provided function would have returned.
703 */
704 template <typename Func>
705 constexpr auto andThen(Func&& aFunc) & {
706 static_assert(std::is_invocable_v<Func, T&>);
707 using U = std::invoke_result_t<Func, T&>;
708 static_assert(detail::IsMaybe<U>::value);
709 if (isSome()) {
710 return std::invoke(std::forward<Func>(aFunc), ref());
711 }
712 return std::remove_cv_t<std::remove_reference_t<U>>{};
713 }
714
715 template <typename Func>
716 constexpr auto andThen(Func&& aFunc) const& {
717 static_assert(std::is_invocable_v<Func, const T&>);
718 using U = std::invoke_result_t<Func, const T&>;
719 static_assert(detail::IsMaybe<U>::value);
720 if (isSome()) {
721 return std::invoke(std::forward<Func>(aFunc), ref());
722 }
723 return std::remove_cv_t<std::remove_reference_t<U>>{};
724 }
725
726 template <typename Func>
727 constexpr auto andThen(Func&& aFunc) && {
728 static_assert(std::is_invocable_v<Func, T&&>);
729 using U = std::invoke_result_t<Func, T&&>;
730 static_assert(detail::IsMaybe<U>::value);
731 if (isSome()) {
732 return std::invoke(std::forward<Func>(aFunc), extract());
733 }
734 return std::remove_cv_t<std::remove_reference_t<U>>{};
735 }
736
737 template <typename Func>
738 constexpr auto andThen(Func&& aFunc) const&& {
739 static_assert(std::is_invocable_v<Func, const T&&>);
740 using U = std::invoke_result_t<Func, const T&&>;
741 static_assert(detail::IsMaybe<U>::value);
742 if (isSome()) {
743 return std::invoke(std::forward<Func>(aFunc), extract());
744 }
745 return std::remove_cv_t<std::remove_reference_t<U>>{};
746 }
747
748 /*
749 * If |isNothing()|, runs the provided function or functor and returns its
750 * result. If |isSome()|, returns the contained value wrapped in a Maybe.
751 */
752 template <typename Func>
753 constexpr Maybe orElse(Func&& aFunc) & {
754 static_assert(std::is_invocable_v<Func>);
755 using U = std::invoke_result_t<Func>;
756 static_assert(
757 std::is_same_v<Maybe, std::remove_cv_t<std::remove_reference_t<U>>>);
758 if (isSome()) {
759 return *this;
760 }
761 return std::invoke(std::forward<Func>(aFunc));
762 }
763
764 template <typename Func>
765 constexpr Maybe orElse(Func&& aFunc) const& {
766 static_assert(std::is_invocable_v<Func>);
767 using U = std::invoke_result_t<Func>;
768 static_assert(
769 std::is_same_v<Maybe, std::remove_cv_t<std::remove_reference_t<U>>>);
770 if (isSome()) {
771 return *this;
772 }
773 return std::invoke(std::forward<Func>(aFunc));
774 }
775
776 template <typename Func>
777 constexpr Maybe orElse(Func&& aFunc) && {
778 static_assert(std::is_invocable_v<Func>);
779 using U = std::invoke_result_t<Func>;
780 static_assert(
781 std::is_same_v<Maybe, std::remove_cv_t<std::remove_reference_t<U>>>);
782 if (isSome()) {
783 return std::move(*this);
784 }
785 return std::invoke(std::forward<Func>(aFunc));
786 }
787
788 template <typename Func>
789 constexpr Maybe orElse(Func&& aFunc) const&& {
790 static_assert(std::is_invocable_v<Func>);
791 using U = std::invoke_result_t<Func>;
792 static_assert(
793 std::is_same_v<Maybe, std::remove_cv_t<std::remove_reference_t<U>>>);
794 if (isSome()) {
795 return std::move(*this);
796 }
797 return std::invoke(std::forward<Func>(aFunc));
798 }
799
800 /* If |isSome()|, empties this Maybe and destroys its contents. */
801 constexpr void reset() {
802 if (isSome()) {
803 if constexpr (!std::is_trivially_destructible_v<T>) {
804 /*
805 * Static analyzer gets confused if we have Maybe<MutexAutoLock>,
806 * so we suppress thread-safety warnings here
807 */
808 MOZ_PUSH_IGNORE_THREAD_SAFETYGCC diagnostic push GCC diagnostic ignored "-Wthread-safety"
809 ref().T::~T();
810 MOZ_POP_THREAD_SAFETYGCC diagnostic pop
811 poisonData();
812 }
813 mIsSome = false;
814 }
815 }
816
817 /*
818 * Constructs a T value in-place in this empty Maybe<T>'s storage. The
819 * arguments to |emplace()| are the parameters to T's constructor.
820 */
821 template <typename... Args>
822 constexpr void emplace(Args&&... aArgs);
823
824 template <typename U>
825 constexpr std::enable_if_t<std::is_same_v<T, U> &&
826 std::is_copy_constructible_v<U> &&
827 !std::is_move_constructible_v<U>>
828 emplace(U&& aArgs) {
829 emplace(aArgs);
830 }
831
832 friend std::ostream& operator<<(std::ostream& aStream,
833 const Maybe<T>& aMaybe) {
834 if (aMaybe) {
835 aStream << aMaybe.ref();
836 } else {
837 aStream << "<Nothing>";
838 }
839 return aStream;
840 }
841};
842
843template <typename T>
844class Maybe<T&> {
845 public:
846 constexpr Maybe() = default;
847 constexpr MOZ_IMPLICIT Maybe(Nothing) {}
848
849 void emplace(T& aRef) { mValue = &aRef; }
850
851 /* Methods that check whether this Maybe contains a value */
852 constexpr explicit operator bool() const { return isSome(); }
853 constexpr bool isSome() const { return mValue; }
854 constexpr bool isNothing() const { return !mValue; }
855
856 T& ref() const {
857 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 857); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 857; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
858 return *mValue;
859 }
860
861 T* operator->() const { return &ref(); }
862 T& operator*() const { return ref(); }
863
864 // Deliberately not defining value and ptr accessors, as these may be
865 // confusing on a reference-typed Maybe.
866
867 // XXX Should we define refOr?
868
869 void reset() { mValue = nullptr; }
870
871 template <typename Func>
872 const Maybe& apply(Func&& aFunc) const {
873 if (isSome()) {
874 std::forward<Func>(aFunc)(ref());
875 }
876 return *this;
877 }
878
879 template <typename Func>
880 auto map(Func&& aFunc) const {
881 Maybe<decltype(std::forward<Func>(aFunc)(ref()))> val;
882 if (isSome()) {
883 val.emplace(std::forward<Func>(aFunc)(ref()));
884 }
885 return val;
886 }
887
888 template <typename Func>
889 constexpr auto andThen(Func&& aFunc) const {
890 static_assert(std::is_invocable_v<Func, T&>);
891 using U = std::invoke_result_t<Func, T&>;
892 static_assert(detail::IsMaybe<U>::value);
893 if (isSome()) {
894 return std::invoke(std::forward<Func>(aFunc), ref());
895 }
896 return std::remove_cv_t<std::remove_reference_t<U>>{};
897 }
898
899 template <typename Func>
900 constexpr Maybe orElse(Func&& aFunc) const {
901 static_assert(std::is_invocable_v<Func>);
902 using U = std::invoke_result_t<Func>;
903 static_assert(
904 std::is_same_v<Maybe, std::remove_cv_t<std::remove_reference_t<U>>>);
905 if (isSome()) {
906 return *this;
907 }
908 return std::invoke(std::forward<Func>(aFunc));
909 }
910
911 bool refEquals(const Maybe<T&>& aOther) const {
912 return mValue == aOther.mValue;
913 }
914
915 bool refEquals(const T& aOther) const { return mValue == &aOther; }
916
917 private:
918 T* mValue = nullptr;
919};
920
921template <typename T>
922constexpr T Maybe<T>::value() const& {
923 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 923; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
924 return ref();
925}
926
927template <typename T>
928constexpr T Maybe<T>::value() && {
929 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 929); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 929; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
930 return std::move(ref());
931}
932
933template <typename T>
934constexpr T Maybe<T>::value() const&& {
935 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 935; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
936 return std::move(ref());
937}
938
939template <typename T>
940T* Maybe<T>::ptr() {
941 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 941); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 941; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
942 return &ref();
943}
944
945template <typename T>
946constexpr const T* Maybe<T>::ptr() const {
947 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 947); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 947; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
948 return &ref();
949}
950
951template <typename T>
952constexpr T* Maybe<T>::operator->() {
953 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 953); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 953; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
954 return ptr();
955}
956
957template <typename T>
958constexpr const T* Maybe<T>::operator->() const {
959 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 959); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 959; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
960 return ptr();
961}
962
963template <typename T>
964constexpr T& Maybe<T>::ref() & {
965 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 965); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 965; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
966 return mStorage.val;
967}
968
969template <typename T>
970constexpr const T& Maybe<T>::ref() const& {
971 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 971); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 971; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
972 return mStorage.val;
973}
974
975template <typename T>
976constexpr T&& Maybe<T>::ref() && {
977 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 977); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 977; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
978 return std::move(mStorage.val);
979}
980
981template <typename T>
982constexpr const T&& Maybe<T>::ref() const&& {
983 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 983); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 983; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
984 return std::move(mStorage.val);
985}
986
987template <typename T>
988constexpr T& Maybe<T>::operator*() & {
989 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 989); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 989; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
990 return ref();
991}
992
993template <typename T>
994constexpr const T& Maybe<T>::operator*() const& {
995 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 995; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
996 return ref();
997}
998
999template <typename T>
1000constexpr T&& Maybe<T>::operator*() && {
1001 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 1001); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 1001; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1002 return std::move(ref());
1003}
1004
1005template <typename T>
1006constexpr const T&& Maybe<T>::operator*() const&& {
1007 MOZ_RELEASE_ASSERT(isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 1007); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "isSome()"
")"); do { *((volatile int*)__null) = 1007; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1008 return std::move(ref());
1009}
1010
1011template <typename T>
1012template <typename... Args>
1013constexpr void Maybe<T>::emplace(Args&&... aArgs) {
1014 MOZ_RELEASE_ASSERT(!isSome())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!isSome())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!isSome()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Maybe.h"
, 1014); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!isSome()"
")"); do { *((volatile int*)__null) = 1014; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1015 ::new (KnownNotNull, &mStorage.val) T(std::forward<Args>(aArgs)...);
1016 mIsSome = true;
1017}
1018
1019/*
1020 * Some() creates a Maybe<T> value containing the provided T value. If T has a
1021 * move constructor, it's used to make this as efficient as possible.
1022 *
1023 * Some() selects the type of Maybe it returns by removing any const, volatile,
1024 * or reference qualifiers from the type of the value you pass to it. This gives
1025 * it more intuitive behavior when used in expressions, but it also means that
1026 * if you need to construct a Maybe value that holds a const, volatile, or
1027 * reference value, you need to use emplace() instead.
1028 */
1029template <typename T, typename U>
1030constexpr Maybe<U> Some(T&& aValue) {
1031 return {std::forward<T>(aValue), typename Maybe<U>::SomeGuard{}};
1032}
1033
1034template <typename T>
1035constexpr Maybe<T&> SomeRef(T& aValue) {
1036 Maybe<T&> value;
1037 value.emplace(aValue);
1038 return value;
1039}
1040
1041template <typename T>
1042constexpr Maybe<T&> ToMaybeRef(T* const aPtr) {
1043 return aPtr ? SomeRef(*aPtr) : Nothing{};
1044}
1045
1046template <typename T>
1047Maybe<std::remove_cv_t<std::remove_reference_t<T>>> ToMaybe(T* aPtr) {
1048 if (aPtr) {
1049 return Some(*aPtr);
1050 }
1051 return Nothing();
1052}
1053
1054/*
1055 * Two Maybe<T> values are equal if
1056 * - both are Nothing, or
1057 * - both are Some, and the values they contain are equal.
1058 */
1059template <typename T>
1060constexpr bool operator==(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1061 static_assert(!std::is_reference_v<T>,
1062 "operator== is not defined for Maybe<T&>, compare values or "
1063 "addresses explicitly instead");
1064 if (aLHS.isNothing() != aRHS.isNothing()) {
1065 return false;
1066 }
1067 return aLHS.isNothing() || *aLHS == *aRHS;
1068}
1069
1070template <typename T>
1071constexpr bool operator!=(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1072 return !(aLHS == aRHS);
1073}
1074
1075/*
1076 * We support comparison to Nothing to allow reasonable expressions like:
1077 * if (maybeValue == Nothing()) { ... }
1078 */
1079template <typename T>
1080constexpr bool operator==(const Maybe<T>& aLHS, const Nothing& aRHS) {
1081 return aLHS.isNothing();
1082}
1083
1084template <typename T>
1085constexpr bool operator!=(const Maybe<T>& aLHS, const Nothing& aRHS) {
1086 return !(aLHS == aRHS);
1087}
1088
1089template <typename T>
1090constexpr bool operator==(const Nothing& aLHS, const Maybe<T>& aRHS) {
1091 return aRHS.isNothing();
1092}
1093
1094template <typename T>
1095constexpr bool operator!=(const Nothing& aLHS, const Maybe<T>& aRHS) {
1096 return !(aLHS == aRHS);
1097}
1098
1099/*
1100 * Maybe<T> values are ordered in the same way T values are ordered, except that
1101 * Nothing comes before anything else.
1102 */
1103template <typename T>
1104constexpr bool operator<(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1105 if (aLHS.isNothing()) {
1106 return aRHS.isSome();
1107 }
1108 if (aRHS.isNothing()) {
1109 return false;
1110 }
1111 return *aLHS < *aRHS;
1112}
1113
1114template <typename T>
1115constexpr bool operator>(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1116 return !(aLHS < aRHS || aLHS == aRHS);
1117}
1118
1119template <typename T>
1120constexpr bool operator<=(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1121 return aLHS < aRHS || aLHS == aRHS;
1122}
1123
1124template <typename T>
1125constexpr bool operator>=(const Maybe<T>& aLHS, const Maybe<T>& aRHS) {
1126 return !(aLHS < aRHS);
1127}
1128
1129template <typename T>
1130inline void ImplCycleCollectionTraverse(
1131 nsCycleCollectionTraversalCallback& aCallback, mozilla::Maybe<T>& aField,
1132 const char* aName, uint32_t aFlags = 0) {
1133 if (aField) {
1134 ImplCycleCollectionTraverse(aCallback, aField.ref(), aName, aFlags);
1135 }
1136}
1137
1138template <typename T>
1139inline void ImplCycleCollectionUnlink(mozilla::Maybe<T>& aField) {
1140 if (aField) {
1141 ImplCycleCollectionUnlink(aField.ref());
1142 }
1143}
1144
1145} // namespace mozilla
1146
1147#endif /* mozilla_Maybe_h */

/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/MaybeStorageBase.h

1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7/* Internal storage class used e.g. by Maybe and Result. This file doesn't
8 * contain any public declarations. */
9
10#ifndef mfbt_MaybeStorageBase_h
11#define mfbt_MaybeStorageBase_h
12
13#include <type_traits>
14#include <utility>
15
16namespace mozilla::detail {
17
18template <typename T>
19constexpr bool IsTriviallyDestructibleAndCopyable =
20 std::is_trivially_destructible_v<T> &&
21 (std::is_trivially_copy_constructible_v<T> ||
22 !std::is_copy_constructible_v<T>);
23
24template <typename T, bool TriviallyDestructibleAndCopyable =
25 IsTriviallyDestructibleAndCopyable<T>>
26struct MaybeStorageBase;
27
28template <typename T>
29struct MaybeStorageBase<T, false> {
30 protected:
31 using NonConstT = std::remove_const_t<T>;
32
33 union Union {
34 Union() {}
5
Returning without writing to 'this->val.mProfilingStack'
35 explicit Union(const T& aVal) : val{aVal} {}
36 template <typename U,
37 typename = std::enable_if_t<std::is_move_constructible_v<U>>>
38 explicit Union(U&& aVal) : val{std::forward<U>(aVal)} {}
39 template <typename... Args>
40 explicit Union(std::in_place_t, Args&&... aArgs)
41 : val{std::forward<Args>(aArgs)...} {}
42
43 ~Union() {}
22
Calling '~AutoProfilerLabel'
44
45 NonConstT val;
46 } mStorage;
47
48 public:
49 MaybeStorageBase() = default;
4
Calling default constructor for 'Union'
6
Returning from default constructor for 'Union'
7
Returning without writing to 'this->mStorage.val.mProfilingStack'
50 explicit MaybeStorageBase(const T& aVal) : mStorage{aVal} {}
51 explicit MaybeStorageBase(T&& aVal) : mStorage{std::move(aVal)} {}
52 template <typename... Args>
53 explicit MaybeStorageBase(std::in_place_t, Args&&... aArgs)
54 : mStorage{std::in_place, std::forward<Args>(aArgs)...} {}
55
56 const T* addr() const { return &mStorage.val; }
57 T* addr() { return &mStorage.val; }
58};
59
60template <typename T>
61struct MaybeStorageBase<T, true> {
62 protected:
63 using NonConstT = std::remove_const_t<T>;
64
65 union Union {
66 constexpr Union() : dummy() {}
67 constexpr explicit Union(const T& aVal) : val{aVal} {}
68 constexpr explicit Union(T&& aVal) : val{std::move(aVal)} {}
69 template <typename... Args>
70 constexpr explicit Union(std::in_place_t, Args&&... aArgs)
71 : val{std::forward<Args>(aArgs)...} {}
72
73 NonConstT val;
74 char dummy;
75 } mStorage;
76
77 public:
78 constexpr MaybeStorageBase() = default;
79 constexpr explicit MaybeStorageBase(const T& aVal) : mStorage{aVal} {}
80 constexpr explicit MaybeStorageBase(T&& aVal) : mStorage{std::move(aVal)} {}
81
82 template <typename... Args>
83 constexpr explicit MaybeStorageBase(std::in_place_t, Args&&... aArgs)
84 : mStorage{std::in_place, std::forward<Args>(aArgs)...} {}
85
86 constexpr const T* addr() const { return &mStorage.val; }
87 constexpr T* addr() { return &mStorage.val; }
88};
89
90} // namespace mozilla::detail
91
92#endif

/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerLabels.h

1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7// This header contains all definitions related to Base Profiler labels (outside
8// of XUL).
9// It is safe to include unconditionally, and only defines empty macros if
10// MOZ_GECKO_PROFILER is not set.
11
12#ifndef BaseProfilerLabels_h
13#define BaseProfilerLabels_h
14
15#ifndef MOZ_GECKO_PROFILER1
16
17# define AUTO_BASE_PROFILER_LABEL(label, categoryPair)::mozilla::baseprofiler::AutoProfilerLabel raiiObject17( label
, nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
)
18# define AUTO_BASE_PROFILER_LABEL_CATEGORY_PAIR(categoryPair)::mozilla::baseprofiler::AutoProfilerLabel raiiObject18( "", nullptr
, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
, uint32_t(::mozilla::baseprofiler::ProfilingStackFrame::Flags
:: LABEL_DETERMINED_BY_CATEGORY_PAIR))
19# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_CSTR(label, categoryPair, cStr)::mozilla::baseprofiler::AutoProfilerLabel raiiObject19( label
, cStr, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
)
20# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING(label, categoryPair, str)Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace(str); raiiObjectString
.emplace( label, autoStr->c_str(), ::mozilla::baseprofiler
::ProfilingCategoryPair::categoryPair); }
21# define AUTO_BASE_PROFILER_LABEL_FAST(label, categoryPair, ctx)::mozilla::baseprofiler::AutoProfilerLabel raiiObject21( ctx,
label, nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair)
22# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_FAST(label, dynamicString, \::mozilla::baseprofiler::AutoProfilerLabel raiiObject23( ctx,
label, dynamicString, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair, flags)
23 categoryPair, ctx, flags)::mozilla::baseprofiler::AutoProfilerLabel raiiObject23( ctx,
label, dynamicString, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair, flags)
24
25#else // !MOZ_GECKO_PROFILER
26
27# include "BaseProfilingStack.h"
28
29# include "mozilla/Attributes.h"
30# include "mozilla/Maybe.h"
31# include "mozilla/BaseProfilerRAIIMacro.h"
32# include "mozilla/BaseProfilerState.h"
33# include "mozilla/ThreadLocal.h"
34
35# include <stdint.h>
36# include <string>
37
38namespace mozilla::baseprofiler {
39
40// Insert an RAII object in this scope to enter a label stack frame. Any
41// samples collected in this scope will contain this label in their stack.
42// The label argument must be a static C string. It is usually of the
43// form "ClassName::FunctionName". (Ideally we'd use the compiler to provide
44// that for us, but __func__ gives us the function name without the class
45// name.) If the label applies to only part of a function, you can qualify it
46// like this: "ClassName::FunctionName:PartName".
47//
48// Use AUTO_BASE_PROFILER_LABEL_DYNAMIC_* if you want to add additional /
49// dynamic information to the label stack frame.
50# define AUTO_BASE_PROFILER_LABEL(label, categoryPair)::mozilla::baseprofiler::AutoProfilerLabel raiiObject50( label
, nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
)
\
51 ::mozilla::baseprofiler::AutoProfilerLabel PROFILER_RAIIraiiObject51( \
52 label, nullptr, \
53 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair)
54
55// Similar to AUTO_BASE_PROFILER_LABEL, but with only one argument: the category
56// pair. The label string is taken from the category pair. This is convenient
57// for labels like
58// AUTO_BASE_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_LayerBuilding) which would
59// otherwise just repeat the string.
60# define AUTO_BASE_PROFILER_LABEL_CATEGORY_PAIR(categoryPair)::mozilla::baseprofiler::AutoProfilerLabel raiiObject60( "", nullptr
, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
, uint32_t(::mozilla::baseprofiler::ProfilingStackFrame::Flags
:: LABEL_DETERMINED_BY_CATEGORY_PAIR))
\
61 ::mozilla::baseprofiler::AutoProfilerLabel PROFILER_RAIIraiiObject61( \
62 "", nullptr, \
63 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair, \
64 uint32_t(::mozilla::baseprofiler::ProfilingStackFrame::Flags:: \
65 LABEL_DETERMINED_BY_CATEGORY_PAIR))
66
67// Similar to AUTO_BASE_PROFILER_LABEL, but with an additional string. The
68// inserted RAII object stores the cStr pointer in a field; it does not copy the
69// string.
70//
71// WARNING: This means that the string you pass to this macro needs to live at
72// least until the end of the current scope. Be careful using this macro with
73// ns[C]String; the other AUTO_BASE_PROFILER_LABEL_DYNAMIC_* macros below are
74// preferred because they avoid this problem.
75//
76// If the profiler samples the current thread and walks the label stack while
77// this RAII object is on the stack, it will copy the supplied string into the
78// profile buffer. So there's one string copy operation, and it happens at
79// sample time.
80//
81// Compare this to the plain AUTO_BASE_PROFILER_LABEL macro, which only accepts
82// literal strings: When the label stack frames generated by
83// AUTO_BASE_PROFILER_LABEL are sampled, no string copy needs to be made because
84// the profile buffer can just store the raw pointers to the literal strings.
85// Consequently, AUTO_BASE_PROFILER_LABEL frames take up considerably less space
86// in the profile buffer than AUTO_BASE_PROFILER_LABEL_DYNAMIC_* frames.
87# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_CSTR(label, categoryPair, cStr)::mozilla::baseprofiler::AutoProfilerLabel raiiObject87( label
, cStr, ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair
)
\
88 ::mozilla::baseprofiler::AutoProfilerLabel PROFILER_RAIIraiiObject88( \
89 label, cStr, \
90 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair)
91
92// Similar to AUTO_BASE_PROFILER_LABEL_DYNAMIC_CSTR, but takes an std::string.
93//
94// Note: The use of the Maybe<>s ensures the scopes for the dynamic string and
95// the AutoProfilerLabel are appropriate, while also not incurring the runtime
96// cost of the string assignment unless the profiler is active. Therefore,
97// unlike AUTO_BASE_PROFILER_LABEL and AUTO_BASE_PROFILER_LABEL_DYNAMIC_CSTR,
98// this macro doesn't push/pop a label when the profiler is inactive.
99# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING(label, categoryPair, str)Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler
::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler
::profiler_is_active()) { autoStr.emplace(str); raiiObjectString
.emplace( label, autoStr->c_str(), ::mozilla::baseprofiler
::ProfilingCategoryPair::categoryPair); }
\
100 Maybe<std::string> autoStr; \
101 Maybe<::mozilla::baseprofiler::AutoProfilerLabel> raiiObjectString; \
102 if (::mozilla::baseprofiler::profiler_is_active()) { \
103 autoStr.emplace(str); \
104 raiiObjectString.emplace( \
105 label, autoStr->c_str(), \
106 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair); \
107 }
108
109// Similar to AUTO_BASE_PROFILER_LABEL, but accepting a JSContext* parameter,
110// and a no-op if the profiler is disabled. Used to annotate functions for which
111// overhead in the range of nanoseconds is noticeable. It avoids overhead from
112// the TLS lookup because it can get the ProfilingStack from the JS context, and
113// avoids almost all overhead in the case where the profiler is disabled.
114# define AUTO_BASE_PROFILER_LABEL_FAST(label, categoryPair, ctx)::mozilla::baseprofiler::AutoProfilerLabel raiiObject114( ctx
, label, nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair)
\
115 ::mozilla::baseprofiler::AutoProfilerLabel PROFILER_RAIIraiiObject115( \
116 ctx, label, nullptr, \
117 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair)
118
119// Similar to AUTO_BASE_PROFILER_LABEL_FAST, but also takes an extra string and
120// an additional set of flags. The flags parameter should carry values from the
121// ProfilingStackFrame::Flags enum.
122# define AUTO_BASE_PROFILER_LABEL_DYNAMIC_FAST(label, dynamicString, \::mozilla::baseprofiler::AutoProfilerLabel raiiObject123( ctx
, label, dynamicString, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair, flags)
123 categoryPair, ctx, flags)::mozilla::baseprofiler::AutoProfilerLabel raiiObject123( ctx
, label, dynamicString, ::mozilla::baseprofiler::ProfilingCategoryPair
::categoryPair, flags)
\
124 ::mozilla::baseprofiler::AutoProfilerLabel PROFILER_RAIIraiiObject124( \
125 ctx, label, dynamicString, \
126 ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair, flags)
127
128// This class creates a non-owning ProfilingStack reference. Objects of this
129// class are stack-allocated, and so exist within a thread, and are thus bounded
130// by the lifetime of the thread, which ensures that the references held can't
131// be used after the ProfilingStack is destroyed.
132class MOZ_RAII AutoProfilerLabel {
133 public:
134 // This is the AUTO_BASE_PROFILER_LABEL and AUTO_BASE_PROFILER_LABEL_DYNAMIC
135 // variant.
136 AutoProfilerLabel(const char* aLabel, const char* aDynamicString,
137 ProfilingCategoryPair aCategoryPair, uint32_t aFlags = 0) {
138 // Get the ProfilingStack from TLS.
139 Push(GetProfilingStack(), aLabel, aDynamicString, aCategoryPair, aFlags);
140 }
141
142 void Push(ProfilingStack* aProfilingStack, const char* aLabel,
143 const char* aDynamicString, ProfilingCategoryPair aCategoryPair,
144 uint32_t aFlags = 0) {
145 // This function runs both on and off the main thread.
146
147 mProfilingStack = aProfilingStack;
148 if (mProfilingStack) {
149 mProfilingStack->pushLabelFrame(aLabel, aDynamicString, this,
150 aCategoryPair, aFlags);
151 }
152 }
153
154 ~AutoProfilerLabel() {
155 // This function runs both on and off the main thread.
156
157 if (mProfilingStack) {
23
Branch condition evaluates to a garbage value
158 mProfilingStack->pop();
159 }
160 }
161
162 MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) static ProfilingStack* GetProfilingStack();
163
164 private:
165 // We save a ProfilingStack pointer in the ctor so we don't have to redo the
166 // TLS lookup in the dtor.
167 ProfilingStack* mProfilingStack;
168
169 public:
170 // See the comment on the definition in platform.cpp for details about this.
171 static MOZ_THREAD_LOCAL(ProfilingStack*)__thread ::mozilla::detail::ThreadLocal< ProfilingStack*, ::
mozilla::detail::ThreadLocalNativeStorage>
sProfilingStack;
172};
173
174} // namespace mozilla::baseprofiler
175
176#endif // !MOZ_GECKO_PROFILER
177
178#endif // BaseProfilerLabels_h