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-18/lib/clang/18 -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/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../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 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -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-05-16-034744-15991-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/works