/work/obj-fuzz/dist/include/mozilla/RangedPtr.h
Line | Count | Source (jump to first uncovered line) |
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 |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | /* |
8 | | * Implements a smart pointer asserted to remain within a range specified at |
9 | | * construction. |
10 | | */ |
11 | | |
12 | | #ifndef mozilla_RangedPtr_h |
13 | | #define mozilla_RangedPtr_h |
14 | | |
15 | | #include "mozilla/ArrayUtils.h" |
16 | | #include "mozilla/Assertions.h" |
17 | | #include "mozilla/Attributes.h" |
18 | | |
19 | | #include <stdint.h> |
20 | | |
21 | | namespace mozilla { |
22 | | |
23 | | /* |
24 | | * RangedPtr is a smart pointer restricted to an address range specified at |
25 | | * creation. The pointer (and any smart pointers derived from it) must remain |
26 | | * within the range [start, end] (inclusive of end to facilitate use as |
27 | | * sentinels). Dereferencing or indexing into the pointer (or pointers derived |
28 | | * from it) must remain within the range [start, end). All the standard pointer |
29 | | * operators are defined on it; in debug builds these operations assert that the |
30 | | * range specified at construction is respected. |
31 | | * |
32 | | * In theory passing a smart pointer instance as an argument can be slightly |
33 | | * slower than passing a T* (due to ABI requirements for passing structs versus |
34 | | * passing pointers), if the method being called isn't inlined. If you are in |
35 | | * extremely performance-critical code, you may want to be careful using this |
36 | | * smart pointer as an argument type. |
37 | | * |
38 | | * RangedPtr<T> intentionally does not implicitly convert to T*. Use get() to |
39 | | * explicitly convert to T*. Keep in mind that the raw pointer of course won't |
40 | | * implement bounds checking in debug builds. |
41 | | */ |
42 | | template<typename T> |
43 | | class RangedPtr |
44 | | { |
45 | | T* mPtr; |
46 | | |
47 | | #ifdef DEBUG |
48 | | T* const mRangeStart; |
49 | | T* const mRangeEnd; |
50 | | #endif |
51 | | |
52 | | void checkSanity() |
53 | 66.1M | { |
54 | 66.1M | MOZ_ASSERT(mRangeStart <= mPtr); |
55 | 66.1M | MOZ_ASSERT(mPtr <= mRangeEnd); |
56 | 66.1M | } mozilla::RangedPtr<unsigned char>::checkSanity() Line | Count | Source | 53 | 1.60M | { | 54 | 1.60M | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 1.60M | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 1.60M | } |
mozilla::RangedPtr<char16_t>::checkSanity() Line | Count | Source | 53 | 3 | { | 54 | 3 | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 3 | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 3 | } |
mozilla::RangedPtr<char16_t const>::checkSanity() Line | Count | Source | 53 | 53.3k | { | 54 | 53.3k | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 53.3k | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 53.3k | } |
mozilla::RangedPtr<unsigned char const>::checkSanity() Line | Count | Source | 53 | 6.52M | { | 54 | 6.52M | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 6.52M | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 6.52M | } |
mozilla::RangedPtr<char const>::checkSanity() Line | Count | Source | 53 | 7.77M | { | 54 | 7.77M | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 7.77M | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 7.77M | } |
Unexecuted instantiation: mozilla::RangedPtr<int const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::checkSanity() mozilla::RangedPtr<char>::checkSanity() Line | Count | Source | 53 | 50.1M | { | 54 | 50.1M | MOZ_ASSERT(mRangeStart <= mPtr); | 55 | 50.1M | MOZ_ASSERT(mPtr <= mRangeEnd); | 56 | 50.1M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::gfx::FontVariation const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<int>::checkSanity() Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::checkSanity() |
57 | | |
58 | | /* Creates a new pointer for |aPtr|, restricted to this pointer's range. */ |
59 | | RangedPtr<T> create(T* aPtr) const |
60 | 28.4M | { |
61 | | #ifdef DEBUG |
62 | | return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd); |
63 | | #else |
64 | | return RangedPtr<T>(aPtr, nullptr, size_t(0)); |
65 | 28.4M | #endif |
66 | 28.4M | } mozilla::RangedPtr<unsigned char>::create(unsigned char*) const Line | Count | Source | 60 | 1.60M | { | 61 | | #ifdef DEBUG | 62 | | return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd); | 63 | | #else | 64 | | return RangedPtr<T>(aPtr, nullptr, size_t(0)); | 65 | 1.60M | #endif | 66 | 1.60M | } |
mozilla::RangedPtr<char const>::create(char const*) const Line | Count | Source | 60 | 3.32M | { | 61 | | #ifdef DEBUG | 62 | | return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd); | 63 | | #else | 64 | | return RangedPtr<T>(aPtr, nullptr, size_t(0)); | 65 | 3.32M | #endif | 66 | 3.32M | } |
mozilla::RangedPtr<char16_t const>::create(char16_t const*) const Line | Count | Source | 60 | 43.9k | { | 61 | | #ifdef DEBUG | 62 | | return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd); | 63 | | #else | 64 | | return RangedPtr<T>(aPtr, nullptr, size_t(0)); | 65 | 43.9k | #endif | 66 | 43.9k | } |
Unexecuted instantiation: mozilla::RangedPtr<int const>::create(int const*) const mozilla::RangedPtr<char>::create(char*) const Line | Count | Source | 60 | 23.4M | { | 61 | | #ifdef DEBUG | 62 | | return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd); | 63 | | #else | 64 | | return RangedPtr<T>(aPtr, nullptr, size_t(0)); | 65 | 23.4M | #endif | 66 | 23.4M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::create(mozilla::dom::ipc::StringTableEntry const*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::create(mozilla::SharedPrefMap::Entry const*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::create(mozilla::SharedPrefMap::Header*) const Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::create(unsigned int*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::create(mozilla::dom::ipc::StringTableEntry*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::create(mozilla::dom::ipc::SharedStringMap::Header*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::create(mozilla::dom::ipc::SharedStringMap::Entry const*) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::create(char16_t*) const Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::create(XVisualInfo*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::create(mozilla::wr::ImageKey*) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::create(unsigned char const*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::create(mozilla::wr::BorderSide const*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::create(mozilla::wr::GlyphInstance const*) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::create(mozilla::Keyframe*) const Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::create(js::wasm::ValType const*) const |
67 | | |
68 | | uintptr_t asUintptr() const { return reinterpret_cast<uintptr_t>(mPtr); } |
69 | | |
70 | | public: |
71 | | RangedPtr(T* aPtr, T* aStart, T* aEnd) |
72 | | : mPtr(aPtr) |
73 | | #ifdef DEBUG |
74 | | , mRangeStart(aStart), mRangeEnd(aEnd) |
75 | | #endif |
76 | 6.53M | { |
77 | 6.53M | MOZ_ASSERT(mRangeStart <= mRangeEnd); |
78 | 6.53M | checkSanity(); |
79 | 6.53M | } mozilla::RangedPtr<unsigned char>::RangedPtr(unsigned char*, unsigned char*, unsigned char*) Line | Count | Source | 76 | 6 | { | 77 | 6 | MOZ_ASSERT(mRangeStart <= mRangeEnd); | 78 | 6 | checkSanity(); | 79 | 6 | } |
Unexecuted instantiation: mozilla::RangedPtr<int const>::RangedPtr(int const*, int const*, int const*) Unexecuted instantiation: mozilla::RangedPtr<char>::RangedPtr(char*, char*, char*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::RangedPtr(mozilla::dom::ipc::StringTableEntry const*, mozilla::dom::ipc::StringTableEntry const*, mozilla::dom::ipc::StringTableEntry const*) Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::RangedPtr(unsigned int*, unsigned int*, unsigned int*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::RangedPtr(mozilla::dom::ipc::StringTableEntry*, mozilla::dom::ipc::StringTableEntry*, mozilla::dom::ipc::StringTableEntry*) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::RangedPtr(char16_t*, char16_t*, char16_t*) Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::RangedPtr(XVisualInfo*, XVisualInfo*, XVisualInfo*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::RangedPtr(mozilla::wr::ImageKey*, mozilla::wr::ImageKey*, mozilla::wr::ImageKey*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::gfx::FontVariation const>::RangedPtr(mozilla::gfx::FontVariation const*, mozilla::gfx::FontVariation const*, mozilla::gfx::FontVariation const*) mozilla::RangedPtr<unsigned char const>::RangedPtr(unsigned char const*, unsigned char const*, unsigned char const*) Line | Count | Source | 76 | 6.52M | { | 77 | 6.52M | MOZ_ASSERT(mRangeStart <= mRangeEnd); | 78 | 6.52M | checkSanity(); | 79 | 6.52M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::RangedPtr(mozilla::Keyframe*, mozilla::Keyframe*, mozilla::Keyframe*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::RangedPtr(mozilla::wr::GlyphInstance const*, mozilla::wr::GlyphInstance const*, mozilla::wr::GlyphInstance const*) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::RangedPtr(mozilla::wr::BorderSide const*, mozilla::wr::BorderSide const*, mozilla::wr::BorderSide const*) Unexecuted instantiation: mozilla::RangedPtr<int>::RangedPtr(int*, int*, int*) mozilla::RangedPtr<char16_t const>::RangedPtr(char16_t const*, char16_t const*, char16_t const*) Line | Count | Source | 76 | 9.40k | { | 77 | 9.40k | MOZ_ASSERT(mRangeStart <= mRangeEnd); | 78 | 9.40k | checkSanity(); | 79 | 9.40k | } |
Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::RangedPtr(js::wasm::ValType const*, js::wasm::ValType const*, js::wasm::ValType const*) |
80 | | RangedPtr(T* aPtr, T* aStart, size_t aLength) |
81 | | : mPtr(aPtr) |
82 | | #ifdef DEBUG |
83 | | , mRangeStart(aStart), mRangeEnd(aStart + aLength) |
84 | | #endif |
85 | 28.4M | { |
86 | 28.4M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); |
87 | 28.4M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= |
88 | 28.4M | reinterpret_cast<uintptr_t>(mRangeStart)); |
89 | 28.4M | checkSanity(); |
90 | 28.4M | } mozilla::RangedPtr<unsigned char>::RangedPtr(unsigned char*, unsigned char*, unsigned long) Line | Count | Source | 85 | 1.60M | { | 86 | 1.60M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 87 | 1.60M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 88 | 1.60M | reinterpret_cast<uintptr_t>(mRangeStart)); | 89 | 1.60M | checkSanity(); | 90 | 1.60M | } |
mozilla::RangedPtr<char const>::RangedPtr(char const*, char const*, unsigned long) Line | Count | Source | 85 | 3.32M | { | 86 | 3.32M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 87 | 3.32M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 88 | 3.32M | reinterpret_cast<uintptr_t>(mRangeStart)); | 89 | 3.32M | checkSanity(); | 90 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<int const>::RangedPtr(int const*, int const*, unsigned long) mozilla::RangedPtr<char>::RangedPtr(char*, char*, unsigned long) Line | Count | Source | 85 | 23.4M | { | 86 | 23.4M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 87 | 23.4M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 88 | 23.4M | reinterpret_cast<uintptr_t>(mRangeStart)); | 89 | 23.4M | checkSanity(); | 90 | 23.4M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::RangedPtr(mozilla::dom::ipc::StringTableEntry const*, mozilla::dom::ipc::StringTableEntry const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::RangedPtr(mozilla::SharedPrefMap::Entry const*, mozilla::SharedPrefMap::Entry const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::RangedPtr(mozilla::SharedPrefMap::Header*, mozilla::SharedPrefMap::Header*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::RangedPtr(unsigned int*, unsigned int*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::RangedPtr(mozilla::dom::ipc::StringTableEntry*, mozilla::dom::ipc::StringTableEntry*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::RangedPtr(mozilla::dom::ipc::SharedStringMap::Header*, mozilla::dom::ipc::SharedStringMap::Header*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::RangedPtr(mozilla::dom::ipc::SharedStringMap::Entry const*, mozilla::dom::ipc::SharedStringMap::Entry const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::RangedPtr(char16_t*, char16_t*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::RangedPtr(XVisualInfo*, XVisualInfo*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::RangedPtr(mozilla::wr::ImageKey*, mozilla::wr::ImageKey*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::RangedPtr(unsigned char const*, unsigned char const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::RangedPtr(mozilla::wr::BorderSide const*, mozilla::wr::BorderSide const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::RangedPtr(mozilla::wr::GlyphInstance const*, mozilla::wr::GlyphInstance const*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::RangedPtr(mozilla::Keyframe*, mozilla::Keyframe*, unsigned long) mozilla::RangedPtr<char16_t const>::RangedPtr(char16_t const*, char16_t const*, unsigned long) Line | Count | Source | 85 | 43.9k | { | 86 | 43.9k | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 87 | 43.9k | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 88 | 43.9k | reinterpret_cast<uintptr_t>(mRangeStart)); | 89 | 43.9k | checkSanity(); | 90 | 43.9k | } |
Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::RangedPtr(js::wasm::ValType const*, js::wasm::ValType const*, unsigned long) |
91 | | |
92 | | /* Equivalent to RangedPtr(aPtr, aPtr, aLength). */ |
93 | | RangedPtr(T* aPtr, size_t aLength) |
94 | | : mPtr(aPtr) |
95 | | #ifdef DEBUG |
96 | | , mRangeStart(aPtr), mRangeEnd(aPtr + aLength) |
97 | | #endif |
98 | 4.38M | { |
99 | 4.38M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); |
100 | 4.38M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= |
101 | 4.38M | reinterpret_cast<uintptr_t>(mRangeStart)); |
102 | 4.38M | checkSanity(); |
103 | 4.38M | } mozilla::RangedPtr<char const>::RangedPtr(char const*, unsigned long) Line | Count | Source | 98 | 1.13M | { | 99 | 1.13M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 100 | 1.13M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 101 | 1.13M | reinterpret_cast<uintptr_t>(mRangeStart)); | 102 | 1.13M | checkSanity(); | 103 | 1.13M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::RangedPtr(mozilla::SharedPrefMap::Header*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::RangedPtr(mozilla::SharedPrefMap::Entry const*, unsigned long) mozilla::RangedPtr<unsigned char>::RangedPtr(unsigned char*, unsigned long) Line | Count | Source | 98 | 14 | { | 99 | 14 | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 100 | 14 | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 101 | 14 | reinterpret_cast<uintptr_t>(mRangeStart)); | 102 | 14 | checkSanity(); | 103 | 14 | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::RangedPtr(mozilla::dom::ipc::SharedStringMap::Header*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::RangedPtr(mozilla::dom::ipc::SharedStringMap::Entry const*, unsigned long) mozilla::RangedPtr<char>::RangedPtr(char*, unsigned long) Line | Count | Source | 98 | 3.24M | { | 99 | 3.24M | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 100 | 3.24M | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 101 | 3.24M | reinterpret_cast<uintptr_t>(mRangeStart)); | 102 | 3.24M | checkSanity(); | 103 | 3.24M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::RangedPtr(mozilla::Keyframe*, unsigned long) Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::RangedPtr(char16_t const*, unsigned long) mozilla::RangedPtr<char16_t>::RangedPtr(char16_t*, unsigned long) Line | Count | Source | 98 | 3 | { | 99 | 3 | MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T)); | 100 | 3 | MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >= | 101 | 3 | reinterpret_cast<uintptr_t>(mRangeStart)); | 102 | 3 | checkSanity(); | 103 | 3 | } |
Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::RangedPtr(unsigned char const*, unsigned long) |
104 | | |
105 | | /* Equivalent to RangedPtr(aArr, aArr, N). */ |
106 | | template<size_t N> |
107 | | explicit RangedPtr(T (&aArr)[N]) |
108 | | : mPtr(aArr) |
109 | | #ifdef DEBUG |
110 | | , mRangeStart(aArr), mRangeEnd(aArr + N) |
111 | | #endif |
112 | 0 | { |
113 | 0 | checkSanity(); |
114 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<char16_t>::RangedPtr<21ul>(char16_t (&) [21ul]) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::RangedPtr<14ul>(char16_t (&) [14ul]) |
115 | | |
116 | 3.26M | T* get() const { return mPtr; } mozilla::RangedPtr<unsigned char>::get() const Line | Count | Source | 116 | 14 | T* get() const { return mPtr; } |
mozilla::RangedPtr<char const>::get() const Line | Count | Source | 116 | 2.69k | T* get() const { return mPtr; } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::get() const Unexecuted instantiation: mozilla::RangedPtr<char>::get() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::gfx::FontVariation const>::get() const mozilla::RangedPtr<unsigned char const>::get() const Line | Count | Source | 116 | 3.26M | T* get() const { return mPtr; } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::get() const Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::get() const Unexecuted instantiation: mozilla::RangedPtr<int>::get() const mozilla::RangedPtr<char16_t>::get() const Line | Count | Source | 116 | 3 | T* get() const { return mPtr; } |
|
117 | | |
118 | 0 | explicit operator bool() const { return mPtr != nullptr; } |
119 | | |
120 | | void checkIdenticalRange(const RangedPtr<T>& aOther) const |
121 | 26.7M | { |
122 | 26.7M | MOZ_ASSERT(mRangeStart == aOther.mRangeStart); |
123 | 26.7M | MOZ_ASSERT(mRangeEnd == aOther.mRangeEnd); |
124 | 26.7M | } Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::checkIdenticalRange(mozilla::RangedPtr<unsigned char> const&) const mozilla::RangedPtr<char const>::checkIdenticalRange(mozilla::RangedPtr<char const> const&) const Line | Count | Source | 121 | 3.32M | { | 122 | 3.32M | MOZ_ASSERT(mRangeStart == aOther.mRangeStart); | 123 | 3.32M | MOZ_ASSERT(mRangeEnd == aOther.mRangeEnd); | 124 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::checkIdenticalRange(mozilla::RangedPtr<char16_t const> const&) const Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::checkIdenticalRange(mozilla::RangedPtr<XVisualInfo> const&) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::checkIdenticalRange(mozilla::RangedPtr<unsigned char const> const&) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::checkIdenticalRange(mozilla::RangedPtr<mozilla::Keyframe> const&) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::checkIdenticalRange(mozilla::RangedPtr<char16_t> const&) const mozilla::RangedPtr<char>::checkIdenticalRange(mozilla::RangedPtr<char> const&) const Line | Count | Source | 121 | 23.4M | { | 122 | 23.4M | MOZ_ASSERT(mRangeStart == aOther.mRangeStart); | 123 | 23.4M | MOZ_ASSERT(mRangeEnd == aOther.mRangeEnd); | 124 | 23.4M | } |
|
125 | | |
126 | | template <typename U> |
127 | | RangedPtr<U> |
128 | | ReinterpretCast() const |
129 | 0 | { |
130 | | #ifdef DEBUG |
131 | | return { reinterpret_cast<U*>(mPtr), |
132 | | reinterpret_cast<U*>(mRangeStart), |
133 | | reinterpret_cast<U*>(mRangeEnd) }; |
134 | | #else |
135 | | return { reinterpret_cast<U*>(mPtr), nullptr, nullptr }; |
136 | 0 | #endif |
137 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<int const> mozilla::RangedPtr<unsigned char>::ReinterpretCast<int const>() const Unexecuted instantiation: mozilla::RangedPtr<char> mozilla::RangedPtr<unsigned char>::ReinterpretCast<char>() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const> mozilla::RangedPtr<unsigned char>::ReinterpretCast<mozilla::dom::ipc::StringTableEntry const>() const Unexecuted instantiation: mozilla::RangedPtr<unsigned int> mozilla::RangedPtr<unsigned char>::ReinterpretCast<unsigned int>() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry> mozilla::RangedPtr<unsigned char>::ReinterpretCast<mozilla::dom::ipc::StringTableEntry>() const Unexecuted instantiation: mozilla::RangedPtr<char16_t> mozilla::RangedPtr<unsigned char>::ReinterpretCast<char16_t>() const |
138 | | |
139 | | /* |
140 | | * You can only assign one RangedPtr into another if the two pointers have |
141 | | * the same valid range: |
142 | | * |
143 | | * char arr1[] = "hi"; |
144 | | * char arr2[] = "bye"; |
145 | | * RangedPtr<char> p1(arr1, 2); |
146 | | * p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works |
147 | | * p1 = RangedPtr<char>(arr2, 3); // asserts |
148 | | */ |
149 | | RangedPtr<T>& operator=(const RangedPtr<T>& aOther) |
150 | 26.7M | { |
151 | 26.7M | checkIdenticalRange(aOther); |
152 | 26.7M | mPtr = aOther.mPtr; |
153 | 26.7M | checkSanity(); |
154 | 26.7M | return *this; |
155 | 26.7M | } Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator=(mozilla::RangedPtr<unsigned char> const&) mozilla::RangedPtr<char const>::operator=(mozilla::RangedPtr<char const> const&) Line | Count | Source | 150 | 3.32M | { | 151 | 3.32M | checkIdenticalRange(aOther); | 152 | 3.32M | mPtr = aOther.mPtr; | 153 | 3.32M | checkSanity(); | 154 | 3.32M | return *this; | 155 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator=(mozilla::RangedPtr<char16_t const> const&) Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::operator=(mozilla::RangedPtr<XVisualInfo> const&) Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator=(mozilla::RangedPtr<mozilla::Keyframe> const&) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator=(mozilla::RangedPtr<char16_t> const&) Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator=(mozilla::RangedPtr<unsigned char const> const&) mozilla::RangedPtr<char>::operator=(mozilla::RangedPtr<char> const&) Line | Count | Source | 150 | 23.4M | { | 151 | 23.4M | checkIdenticalRange(aOther); | 152 | 23.4M | mPtr = aOther.mPtr; | 153 | 23.4M | checkSanity(); | 154 | 23.4M | return *this; | 155 | 23.4M | } |
|
156 | | |
157 | | RangedPtr<T> operator+(size_t aInc) const |
158 | 26.7M | { |
159 | 26.7M | MOZ_ASSERT(aInc <= size_t(-1) / sizeof(T)); |
160 | 26.7M | MOZ_ASSERT(asUintptr() + aInc * sizeof(T) >= asUintptr()); |
161 | 26.7M | return create(mPtr + aInc); |
162 | 26.7M | } Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator+(unsigned long) const mozilla::RangedPtr<char const>::operator+(unsigned long) const Line | Count | Source | 158 | 3.32M | { | 159 | 3.32M | MOZ_ASSERT(aInc <= size_t(-1) / sizeof(T)); | 160 | 3.32M | MOZ_ASSERT(asUintptr() + aInc * sizeof(T) >= asUintptr()); | 161 | 3.32M | return create(mPtr + aInc); | 162 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator+(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::operator+(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::operator+(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator+(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator+(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator+(unsigned long) const mozilla::RangedPtr<char>::operator+(unsigned long) const Line | Count | Source | 158 | 23.4M | { | 159 | 23.4M | MOZ_ASSERT(aInc <= size_t(-1) / sizeof(T)); | 160 | 23.4M | MOZ_ASSERT(asUintptr() + aInc * sizeof(T) >= asUintptr()); | 161 | 23.4M | return create(mPtr + aInc); | 162 | 23.4M | } |
|
163 | | |
164 | | RangedPtr<T> operator-(size_t aDec) const |
165 | 0 | { |
166 | 0 | MOZ_ASSERT(aDec <= size_t(-1) / sizeof(T)); |
167 | 0 | MOZ_ASSERT(asUintptr() - aDec * sizeof(T) <= asUintptr()); |
168 | 0 | return create(mPtr - aDec); |
169 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator-(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<char>::operator-(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator-(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator-(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator-(unsigned long) const Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator-(unsigned long) const |
170 | | |
171 | | /* |
172 | | * You can assign a raw pointer into a RangedPtr if the raw pointer is |
173 | | * within the range specified at creation. |
174 | | */ |
175 | | template <typename U> |
176 | | RangedPtr<T>& operator=(U* aPtr) |
177 | | { |
178 | | *this = create(aPtr); |
179 | | return *this; |
180 | | } |
181 | | |
182 | | template <typename U> |
183 | | RangedPtr<T>& operator=(const RangedPtr<U>& aPtr) |
184 | | { |
185 | | MOZ_ASSERT(mRangeStart <= aPtr.mPtr); |
186 | | MOZ_ASSERT(aPtr.mPtr <= mRangeEnd); |
187 | | mPtr = aPtr.mPtr; |
188 | | checkSanity(); |
189 | | return *this; |
190 | | } |
191 | | |
192 | | RangedPtr<T>& operator++() |
193 | 26.7M | { |
194 | 26.7M | return (*this += 1); |
195 | 26.7M | } mozilla::RangedPtr<char const>::operator++() Line | Count | Source | 193 | 3.32M | { | 194 | 3.32M | return (*this += 1); | 195 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator++() Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::operator++() Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator++() Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator++() Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator++() Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator++() mozilla::RangedPtr<char>::operator++() Line | Count | Source | 193 | 23.4M | { | 194 | 23.4M | return (*this += 1); | 195 | 23.4M | } |
|
196 | | |
197 | | RangedPtr<T> operator++(int) |
198 | 26.7M | { |
199 | 26.7M | RangedPtr<T> rcp = *this; |
200 | 26.7M | ++*this; |
201 | 26.7M | return rcp; |
202 | 26.7M | } mozilla::RangedPtr<char const>::operator++(int) Line | Count | Source | 198 | 3.28M | { | 199 | 3.28M | RangedPtr<T> rcp = *this; | 200 | 3.28M | ++*this; | 201 | 3.28M | return rcp; | 202 | 3.28M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator++(int) Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator++(int) Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator++(int) Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator++(int) mozilla::RangedPtr<char>::operator++(int) Line | Count | Source | 198 | 23.4M | { | 199 | 23.4M | RangedPtr<T> rcp = *this; | 200 | 23.4M | ++*this; | 201 | 23.4M | return rcp; | 202 | 23.4M | } |
|
203 | | |
204 | | RangedPtr<T>& operator--() |
205 | 0 | { |
206 | 0 | return (*this -= 1); |
207 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<char>::operator--() Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator--() Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator--() Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator--() Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator--() |
208 | | |
209 | | RangedPtr<T> operator--(int) |
210 | 0 | { |
211 | 0 | RangedPtr<T> rcp = *this; |
212 | 0 | --*this; |
213 | 0 | return rcp; |
214 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator--(int) Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator--(int) |
215 | | |
216 | | RangedPtr<T>& operator+=(size_t aInc) |
217 | 26.7M | { |
218 | 26.7M | *this = *this + aInc; |
219 | 26.7M | return *this; |
220 | 26.7M | } Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator+=(unsigned long) mozilla::RangedPtr<char const>::operator+=(unsigned long) Line | Count | Source | 217 | 3.32M | { | 218 | 3.32M | *this = *this + aInc; | 219 | 3.32M | return *this; | 220 | 3.32M | } |
Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator+=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::operator+=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator+=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator+=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator+=(unsigned long) mozilla::RangedPtr<char>::operator+=(unsigned long) Line | Count | Source | 217 | 23.4M | { | 218 | 23.4M | *this = *this + aInc; | 219 | 23.4M | return *this; | 220 | 23.4M | } |
|
221 | | |
222 | | RangedPtr<T>& operator-=(size_t aDec) |
223 | 0 | { |
224 | 0 | *this = *this - aDec; |
225 | 0 | return *this; |
226 | 0 | } Unexecuted instantiation: mozilla::RangedPtr<char>::operator-=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<unsigned char>::operator-=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator-=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator-=(unsigned long) Unexecuted instantiation: mozilla::RangedPtr<char16_t const>::operator-=(unsigned long) |
227 | | |
228 | | T& operator[](int aIndex) const |
229 | 1.65M | { |
230 | 1.65M | MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T)); |
231 | 1.65M | return *create(mPtr + aIndex); |
232 | 1.65M | } Unexecuted instantiation: mozilla::RangedPtr<int const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<char>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::operator[](int) const mozilla::RangedPtr<unsigned char>::operator[](int) const Line | Count | Source | 229 | 1.60M | { | 230 | 1.60M | MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T)); | 231 | 1.60M | return *create(mPtr + aIndex); | 232 | 1.60M | } |
Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator[](int) const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator[](int) const mozilla::RangedPtr<char16_t const>::operator[](int) const Line | Count | Source | 229 | 43.9k | { | 230 | 43.9k | MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T)); | 231 | 43.9k | return *create(mPtr + aIndex); | 232 | 43.9k | } |
Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::operator[](int) const |
233 | | |
234 | | T& operator*() const |
235 | 28.5M | { |
236 | 28.5M | MOZ_ASSERT(mPtr >= mRangeStart); |
237 | 28.5M | MOZ_ASSERT(mPtr < mRangeEnd); |
238 | 28.5M | return *mPtr; |
239 | 28.5M | } mozilla::RangedPtr<char const>::operator*() const Line | Count | Source | 235 | 3.41M | { | 236 | 3.41M | MOZ_ASSERT(mPtr >= mRangeStart); | 237 | 3.41M | MOZ_ASSERT(mPtr < mRangeEnd); | 238 | 3.41M | return *mPtr; | 239 | 3.41M | } |
mozilla::RangedPtr<char16_t const>::operator*() const Line | Count | Source | 235 | 43.9k | { | 236 | 43.9k | MOZ_ASSERT(mPtr >= mRangeStart); | 237 | 43.9k | MOZ_ASSERT(mPtr < mRangeEnd); | 238 | 43.9k | return *mPtr; | 239 | 43.9k | } |
Unexecuted instantiation: mozilla::RangedPtr<int const>::operator*() const mozilla::RangedPtr<char>::operator*() const Line | Count | Source | 235 | 23.4M | { | 236 | 23.4M | MOZ_ASSERT(mPtr >= mRangeStart); | 237 | 23.4M | MOZ_ASSERT(mPtr < mRangeEnd); | 238 | 23.4M | return *mPtr; | 239 | 23.4M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Entry const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::SharedPrefMap::Header>::operator*() const mozilla::RangedPtr<unsigned char>::operator*() const Line | Count | Source | 235 | 1.60M | { | 236 | 1.60M | MOZ_ASSERT(mPtr >= mRangeStart); | 237 | 1.60M | MOZ_ASSERT(mPtr < mRangeEnd); | 238 | 1.60M | return *mPtr; | 239 | 1.60M | } |
Unexecuted instantiation: mozilla::RangedPtr<unsigned int>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::StringTableEntry>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Header>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::dom::ipc::SharedStringMap::Entry const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<XVisualInfo>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::ImageKey>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<unsigned char const>::operator*() const Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::operator*() const |
240 | | |
241 | | T* operator->() const |
242 | 0 | { |
243 | 0 | MOZ_ASSERT(mPtr >= mRangeStart); |
244 | 0 | MOZ_ASSERT(mPtr < mRangeEnd); |
245 | 0 | return mPtr; |
246 | 0 | } |
247 | | |
248 | | template <typename U> |
249 | | bool operator==(const RangedPtr<U>& aOther) const |
250 | 1 | { |
251 | 1 | return mPtr == aOther.mPtr; |
252 | 1 | } bool mozilla::RangedPtr<char const>::operator==<char const>(mozilla::RangedPtr<char const> const&) const Line | Count | Source | 250 | 1 | { | 251 | 1 | return mPtr == aOther.mPtr; | 252 | 1 | } |
Unexecuted instantiation: bool mozilla::RangedPtr<char16_t const>::operator==<char16_t const>(mozilla::RangedPtr<char16_t const> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<XVisualInfo>::operator==<XVisualInfo>(mozilla::RangedPtr<XVisualInfo> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<mozilla::Keyframe>::operator==<mozilla::Keyframe>(mozilla::RangedPtr<mozilla::Keyframe> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<unsigned char const>::operator==<unsigned char const>(mozilla::RangedPtr<unsigned char const> const&) const |
253 | | template <typename U> |
254 | | bool operator!=(const RangedPtr<U>& aOther) const |
255 | 1 | { |
256 | 1 | return !(*this == aOther); |
257 | 1 | } bool mozilla::RangedPtr<char const>::operator!=<char const>(mozilla::RangedPtr<char const> const&) const Line | Count | Source | 255 | 1 | { | 256 | 1 | return !(*this == aOther); | 257 | 1 | } |
Unexecuted instantiation: bool mozilla::RangedPtr<XVisualInfo>::operator!=<XVisualInfo>(mozilla::RangedPtr<XVisualInfo> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<mozilla::Keyframe>::operator!=<mozilla::Keyframe>(mozilla::RangedPtr<mozilla::Keyframe> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<char16_t const>::operator!=<char16_t const>(mozilla::RangedPtr<char16_t const> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<unsigned char const>::operator!=<unsigned char const>(mozilla::RangedPtr<unsigned char const> const&) const |
258 | | |
259 | | template<typename U> |
260 | | bool operator==(const U* u) const |
261 | 0 | { |
262 | 0 | return mPtr == u; |
263 | 0 | } |
264 | | template<typename U> |
265 | | bool operator!=(const U* u) const |
266 | 0 | { |
267 | 0 | return !(*this == u); |
268 | 0 | } |
269 | | |
270 | | template <typename U> |
271 | | bool operator<(const RangedPtr<U>& aOther) const |
272 | 8 | { |
273 | 8 | return mPtr < aOther.mPtr; |
274 | 8 | } bool mozilla::RangedPtr<char const>::operator< <char const>(mozilla::RangedPtr<char const> const&) const Line | Count | Source | 272 | 8 | { | 273 | 8 | return mPtr < aOther.mPtr; | 274 | 8 | } |
Unexecuted instantiation: bool mozilla::RangedPtr<char16_t const>::operator< <char16_t const>(mozilla::RangedPtr<char16_t const> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<unsigned char const>::operator< <unsigned char const>(mozilla::RangedPtr<unsigned char const> const&) const |
275 | | template <typename U> |
276 | | bool operator<=(const RangedPtr<U>& aOther) const |
277 | | { |
278 | | return mPtr <= aOther.mPtr; |
279 | | } |
280 | | |
281 | | template <typename U> |
282 | | bool operator>(const RangedPtr<U>& aOther) const |
283 | 0 | { |
284 | 0 | return mPtr > aOther.mPtr; |
285 | 0 | } |
286 | | template <typename U> |
287 | | bool operator>=(const RangedPtr<U>& aOther) const |
288 | 0 | { |
289 | 0 | return mPtr >= aOther.mPtr; |
290 | 0 | } Unexecuted instantiation: bool mozilla::RangedPtr<unsigned char const>::operator>=<unsigned char const>(mozilla::RangedPtr<unsigned char const> const&) const Unexecuted instantiation: bool mozilla::RangedPtr<char16_t const>::operator>=<char16_t const>(mozilla::RangedPtr<char16_t const> const&) const |
291 | | |
292 | | size_t operator-(const RangedPtr<T>& aOther) const |
293 | 3.26M | { |
294 | 3.26M | MOZ_ASSERT(mPtr >= aOther.mPtr); |
295 | 3.26M | return PointerRangeSize(aOther.mPtr, mPtr); |
296 | 3.26M | } mozilla::RangedPtr<unsigned char>::operator-(mozilla::RangedPtr<unsigned char> const&) const Line | Count | Source | 293 | 6 | { | 294 | 6 | MOZ_ASSERT(mPtr >= aOther.mPtr); | 295 | 6 | return PointerRangeSize(aOther.mPtr, mPtr); | 296 | 6 | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::gfx::FontVariation const>::operator-(mozilla::RangedPtr<mozilla::gfx::FontVariation const> const&) const mozilla::RangedPtr<unsigned char const>::operator-(mozilla::RangedPtr<unsigned char const> const&) const Line | Count | Source | 293 | 3.26M | { | 294 | 3.26M | MOZ_ASSERT(mPtr >= aOther.mPtr); | 295 | 3.26M | return PointerRangeSize(aOther.mPtr, mPtr); | 296 | 3.26M | } |
Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::BorderSide const>::operator-(mozilla::RangedPtr<mozilla::wr::BorderSide const> const&) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::wr::GlyphInstance const>::operator-(mozilla::RangedPtr<mozilla::wr::GlyphInstance const> const&) const Unexecuted instantiation: mozilla::RangedPtr<mozilla::Keyframe>::operator-(mozilla::RangedPtr<mozilla::Keyframe> const&) const mozilla::RangedPtr<char16_t const>::operator-(mozilla::RangedPtr<char16_t const> const&) const Line | Count | Source | 293 | 4.70k | { | 294 | 4.70k | MOZ_ASSERT(mPtr >= aOther.mPtr); | 295 | 4.70k | return PointerRangeSize(aOther.mPtr, mPtr); | 296 | 4.70k | } |
Unexecuted instantiation: mozilla::RangedPtr<int>::operator-(mozilla::RangedPtr<int> const&) const Unexecuted instantiation: mozilla::RangedPtr<char16_t>::operator-(mozilla::RangedPtr<char16_t> const&) const Unexecuted instantiation: mozilla::RangedPtr<char>::operator-(mozilla::RangedPtr<char> const&) const Unexecuted instantiation: mozilla::RangedPtr<js::wasm::ValType const>::operator-(mozilla::RangedPtr<js::wasm::ValType const> const&) const |
297 | | |
298 | | private: |
299 | | RangedPtr() = delete; |
300 | | }; |
301 | | |
302 | | } /* namespace mozilla */ |
303 | | |
304 | | #endif /* mozilla_RangedPtr_h */ |