1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/memory_graph.proto
3
4 #include "protos/perfetto/trace/memory_graph.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.value_string_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29 , /*decltype(_impl_.value_uint64_)*/::uint64_t{0u}
30 , /*decltype(_impl_.units_)*/0} {}
31 struct MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal {
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal32 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal34 ~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal() {}
35 union { // NOLINT(misc-non-private-member-variables-in-classes)
36 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntryDefaultTypeInternal _MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_default_instance_;
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(::_pbi::ConstantInitialized)40 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(
41 ::_pbi::ConstantInitialized): _impl_{
42 /*decltype(_impl_._has_bits_)*/{}
43 , /*decltype(_impl_._cached_size_)*/{}
44 , /*decltype(_impl_.entries_)*/{}
45 , /*decltype(_impl_.absolute_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
46 , /*decltype(_impl_.id_)*/::uint64_t{0u}
47 , /*decltype(_impl_.size_bytes_)*/::uint64_t{0u}
48 , /*decltype(_impl_.weak_)*/false} {}
49 struct MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal {
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal50 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal()
51 : _instance(::_pbi::ConstantInitialized{}) {}
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal52 ~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal() {}
53 union { // NOLINT(misc-non-private-member-variables-in-classes)
54 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode _instance;
55 };
56 };
57 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNodeDefaultTypeInternal _MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_default_instance_;
MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(::_pbi::ConstantInitialized)58 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(
59 ::_pbi::ConstantInitialized): _impl_{
60 /*decltype(_impl_._has_bits_)*/{}
61 , /*decltype(_impl_._cached_size_)*/{}
62 , /*decltype(_impl_.source_id_)*/::uint64_t{0u}
63 , /*decltype(_impl_.target_id_)*/::uint64_t{0u}
64 , /*decltype(_impl_.importance_)*/0u
65 , /*decltype(_impl_.overridable_)*/false} {}
66 struct MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal {
MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal67 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal()
68 : _instance(::_pbi::ConstantInitialized{}) {}
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal69 ~MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal() {}
70 union { // NOLINT(misc-non-private-member-variables-in-classes)
71 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge _instance;
72 };
73 };
74 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdgeDefaultTypeInternal _MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_default_instance_;
MemoryTrackerSnapshot_ProcessSnapshot(::_pbi::ConstantInitialized)75 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshot::MemoryTrackerSnapshot_ProcessSnapshot(
76 ::_pbi::ConstantInitialized): _impl_{
77 /*decltype(_impl_._has_bits_)*/{}
78 , /*decltype(_impl_._cached_size_)*/{}
79 , /*decltype(_impl_.allocator_dumps_)*/{}
80 , /*decltype(_impl_.memory_edges_)*/{}
81 , /*decltype(_impl_.pid_)*/0} {}
82 struct MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal {
MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal83 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal()
84 : _instance(::_pbi::ConstantInitialized{}) {}
~MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal85 ~MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal() {}
86 union { // NOLINT(misc-non-private-member-variables-in-classes)
87 MemoryTrackerSnapshot_ProcessSnapshot _instance;
88 };
89 };
90 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemoryTrackerSnapshot_ProcessSnapshotDefaultTypeInternal _MemoryTrackerSnapshot_ProcessSnapshot_default_instance_;
MemoryTrackerSnapshot(::_pbi::ConstantInitialized)91 PROTOBUF_CONSTEXPR MemoryTrackerSnapshot::MemoryTrackerSnapshot(
92 ::_pbi::ConstantInitialized): _impl_{
93 /*decltype(_impl_._has_bits_)*/{}
94 , /*decltype(_impl_._cached_size_)*/{}
95 , /*decltype(_impl_.process_memory_dumps_)*/{}
96 , /*decltype(_impl_.global_dump_id_)*/::uint64_t{0u}
97 , /*decltype(_impl_.level_of_detail_)*/0} {}
98 struct MemoryTrackerSnapshotDefaultTypeInternal {
MemoryTrackerSnapshotDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshotDefaultTypeInternal99 PROTOBUF_CONSTEXPR MemoryTrackerSnapshotDefaultTypeInternal()
100 : _instance(::_pbi::ConstantInitialized{}) {}
~MemoryTrackerSnapshotDefaultTypeInternalperfetto::protos::MemoryTrackerSnapshotDefaultTypeInternal101 ~MemoryTrackerSnapshotDefaultTypeInternal() {}
102 union { // NOLINT(misc-non-private-member-variables-in-classes)
103 MemoryTrackerSnapshot _instance;
104 };
105 };
106 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemoryTrackerSnapshotDefaultTypeInternal _MemoryTrackerSnapshot_default_instance_;
107 } // namespace protos
108 } // namespace perfetto
109 namespace perfetto {
110 namespace protos {
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_IsValid(int value)111 bool MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_IsValid(int value) {
112 switch (value) {
113 case 0:
114 case 1:
115 case 2:
116 return true;
117 default:
118 return false;
119 }
120 }
121
122 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_strings[3] = {};
123
124 static const char MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_names[] =
125 "BYTES"
126 "COUNT"
127 "UNSPECIFIED";
128
129 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries[] = {
130 { {MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_names + 0, 5}, 1 },
131 { {MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_names + 5, 5}, 2 },
132 { {MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_names + 10, 11}, 0 },
133 };
134
135 static const int MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries_by_number[] = {
136 2, // 0 -> UNSPECIFIED
137 0, // 1 -> BYTES
138 1, // 2 -> COUNT
139 };
140
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_Name(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units value)141 const std::string& MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_Name(
142 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units value) {
143 static const bool dummy =
144 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
145 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries,
146 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries_by_number,
147 3, MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_strings);
148 (void) dummy;
149 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
150 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries,
151 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries_by_number,
152 3, value);
153 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
154 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_strings[idx].get();
155 }
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units * value)156 bool MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_Parse(
157 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units* value) {
158 int int_value;
159 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
160 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_entries, 3, name, &int_value);
161 if (success) {
162 *value = static_cast<MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units>(int_value);
163 }
164 return success;
165 }
166 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
167 constexpr MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::UNSPECIFIED;
168 constexpr MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::BYTES;
169 constexpr MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::COUNT;
170 constexpr MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Units_MIN;
171 constexpr MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Units_MAX;
172 constexpr int MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Units_ARRAYSIZE;
173 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
MemoryTrackerSnapshot_LevelOfDetail_IsValid(int value)174 bool MemoryTrackerSnapshot_LevelOfDetail_IsValid(int value) {
175 switch (value) {
176 case 0:
177 case 1:
178 case 2:
179 return true;
180 default:
181 return false;
182 }
183 }
184
185 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> MemoryTrackerSnapshot_LevelOfDetail_strings[3] = {};
186
187 static const char MemoryTrackerSnapshot_LevelOfDetail_names[] =
188 "DETAIL_BACKGROUND"
189 "DETAIL_FULL"
190 "DETAIL_LIGHT";
191
192 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry MemoryTrackerSnapshot_LevelOfDetail_entries[] = {
193 { {MemoryTrackerSnapshot_LevelOfDetail_names + 0, 17}, 2 },
194 { {MemoryTrackerSnapshot_LevelOfDetail_names + 17, 11}, 0 },
195 { {MemoryTrackerSnapshot_LevelOfDetail_names + 28, 12}, 1 },
196 };
197
198 static const int MemoryTrackerSnapshot_LevelOfDetail_entries_by_number[] = {
199 1, // 0 -> DETAIL_FULL
200 2, // 1 -> DETAIL_LIGHT
201 0, // 2 -> DETAIL_BACKGROUND
202 };
203
MemoryTrackerSnapshot_LevelOfDetail_Name(MemoryTrackerSnapshot_LevelOfDetail value)204 const std::string& MemoryTrackerSnapshot_LevelOfDetail_Name(
205 MemoryTrackerSnapshot_LevelOfDetail value) {
206 static const bool dummy =
207 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
208 MemoryTrackerSnapshot_LevelOfDetail_entries,
209 MemoryTrackerSnapshot_LevelOfDetail_entries_by_number,
210 3, MemoryTrackerSnapshot_LevelOfDetail_strings);
211 (void) dummy;
212 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
213 MemoryTrackerSnapshot_LevelOfDetail_entries,
214 MemoryTrackerSnapshot_LevelOfDetail_entries_by_number,
215 3, value);
216 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
217 MemoryTrackerSnapshot_LevelOfDetail_strings[idx].get();
218 }
MemoryTrackerSnapshot_LevelOfDetail_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,MemoryTrackerSnapshot_LevelOfDetail * value)219 bool MemoryTrackerSnapshot_LevelOfDetail_Parse(
220 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, MemoryTrackerSnapshot_LevelOfDetail* value) {
221 int int_value;
222 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
223 MemoryTrackerSnapshot_LevelOfDetail_entries, 3, name, &int_value);
224 if (success) {
225 *value = static_cast<MemoryTrackerSnapshot_LevelOfDetail>(int_value);
226 }
227 return success;
228 }
229 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
230 constexpr MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot::DETAIL_FULL;
231 constexpr MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot::DETAIL_LIGHT;
232 constexpr MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot::DETAIL_BACKGROUND;
233 constexpr MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot::LevelOfDetail_MIN;
234 constexpr MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot::LevelOfDetail_MAX;
235 constexpr int MemoryTrackerSnapshot::LevelOfDetail_ARRAYSIZE;
236 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
237
238 // ===================================================================
239
240 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::_Internal {
241 public:
242 using HasBits = decltype(std::declval<MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)243 static void set_has_name(HasBits* has_bits) {
244 (*has_bits)[0] |= 1u;
245 }
set_has_units(HasBits * has_bits)246 static void set_has_units(HasBits* has_bits) {
247 (*has_bits)[0] |= 8u;
248 }
set_has_value_uint64(HasBits * has_bits)249 static void set_has_value_uint64(HasBits* has_bits) {
250 (*has_bits)[0] |= 4u;
251 }
set_has_value_string(HasBits * has_bits)252 static void set_has_value_string(HasBits* has_bits) {
253 (*has_bits)[0] |= 2u;
254 }
255 };
256
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)257 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(::PROTOBUF_NAMESPACE_ID::Arena* arena,
258 bool is_message_owned)
259 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
260 SharedCtor(arena, is_message_owned);
261 // @@protoc_insertion_point(arena_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
262 }
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry & from)263 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry& from)
264 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
265 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry* const _this = this; (void)_this;
266 new (&_impl_) Impl_{
267 decltype(_impl_._has_bits_){from._impl_._has_bits_}
268 , /*decltype(_impl_._cached_size_)*/{}
269 , decltype(_impl_.name_){}
270 , decltype(_impl_.value_string_){}
271 , decltype(_impl_.value_uint64_){}
272 , decltype(_impl_.units_){}};
273
274 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
275 _impl_.name_.InitDefault();
276 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
277 _impl_.name_.Set("", GetArenaForAllocation());
278 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
279 if (from._internal_has_name()) {
280 _this->_impl_.name_.Set(from._internal_name(),
281 _this->GetArenaForAllocation());
282 }
283 _impl_.value_string_.InitDefault();
284 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
285 _impl_.value_string_.Set("", GetArenaForAllocation());
286 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
287 if (from._internal_has_value_string()) {
288 _this->_impl_.value_string_.Set(from._internal_value_string(),
289 _this->GetArenaForAllocation());
290 }
291 ::memcpy(&_impl_.value_uint64_, &from._impl_.value_uint64_,
292 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.units_) -
293 reinterpret_cast<char*>(&_impl_.value_uint64_)) + sizeof(_impl_.units_));
294 // @@protoc_insertion_point(copy_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
295 }
296
SharedCtor(::_pb::Arena * arena,bool is_message_owned)297 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::SharedCtor(
298 ::_pb::Arena* arena, bool is_message_owned) {
299 (void)arena;
300 (void)is_message_owned;
301 new (&_impl_) Impl_{
302 decltype(_impl_._has_bits_){}
303 , /*decltype(_impl_._cached_size_)*/{}
304 , decltype(_impl_.name_){}
305 , decltype(_impl_.value_string_){}
306 , decltype(_impl_.value_uint64_){::uint64_t{0u}}
307 , decltype(_impl_.units_){0}
308 };
309 _impl_.name_.InitDefault();
310 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
311 _impl_.name_.Set("", GetArenaForAllocation());
312 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
313 _impl_.value_string_.InitDefault();
314 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
315 _impl_.value_string_.Set("", GetArenaForAllocation());
316 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
317 }
318
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry()319 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry() {
320 // @@protoc_insertion_point(destructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
321 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
322 (void)arena;
323 return;
324 }
325 SharedDtor();
326 }
327
SharedDtor()328 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::SharedDtor() {
329 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
330 _impl_.name_.Destroy();
331 _impl_.value_string_.Destroy();
332 }
333
SetCachedSize(int size) const334 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::SetCachedSize(int size) const {
335 _impl_._cached_size_.Set(size);
336 }
337
Clear()338 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Clear() {
339 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
340 ::uint32_t cached_has_bits = 0;
341 // Prevent compiler warnings about cached_has_bits being unused
342 (void) cached_has_bits;
343
344 cached_has_bits = _impl_._has_bits_[0];
345 if (cached_has_bits & 0x00000003u) {
346 if (cached_has_bits & 0x00000001u) {
347 _impl_.name_.ClearNonDefaultToEmpty();
348 }
349 if (cached_has_bits & 0x00000002u) {
350 _impl_.value_string_.ClearNonDefaultToEmpty();
351 }
352 }
353 if (cached_has_bits & 0x0000000cu) {
354 ::memset(&_impl_.value_uint64_, 0, static_cast<size_t>(
355 reinterpret_cast<char*>(&_impl_.units_) -
356 reinterpret_cast<char*>(&_impl_.value_uint64_)) + sizeof(_impl_.units_));
357 }
358 _impl_._has_bits_.Clear();
359 _internal_metadata_.Clear<std::string>();
360 }
361
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)362 const char* MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
363 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
364 _Internal::HasBits has_bits{};
365 while (!ctx->Done(&ptr)) {
366 ::uint32_t tag;
367 ptr = ::_pbi::ReadTag(ptr, &tag);
368 switch (tag >> 3) {
369 // optional string name = 1;
370 case 1:
371 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
372 auto str = _internal_mutable_name();
373 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
374 CHK_(ptr);
375 } else {
376 goto handle_unusual;
377 }
378 continue;
379 // optional .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry.Units units = 2;
380 case 2:
381 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
382 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
383 CHK_(ptr);
384 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_IsValid(val))) {
385 _internal_set_units(static_cast<::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units>(val));
386 } else {
387 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
388 }
389 } else {
390 goto handle_unusual;
391 }
392 continue;
393 // optional uint64 value_uint64 = 3;
394 case 3:
395 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
396 _Internal::set_has_value_uint64(&has_bits);
397 _impl_.value_uint64_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
398 CHK_(ptr);
399 } else {
400 goto handle_unusual;
401 }
402 continue;
403 // optional string value_string = 4;
404 case 4:
405 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
406 auto str = _internal_mutable_value_string();
407 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
408 CHK_(ptr);
409 } else {
410 goto handle_unusual;
411 }
412 continue;
413 default:
414 goto handle_unusual;
415 } // switch
416 handle_unusual:
417 if ((tag == 0) || ((tag & 7) == 4)) {
418 CHK_(ptr);
419 ctx->SetLastTag(tag);
420 goto message_done;
421 }
422 ptr = UnknownFieldParse(
423 tag,
424 _internal_metadata_.mutable_unknown_fields<std::string>(),
425 ptr, ctx);
426 CHK_(ptr != nullptr);
427 } // while
428 message_done:
429 _impl_._has_bits_.Or(has_bits);
430 return ptr;
431 failure:
432 ptr = nullptr;
433 goto message_done;
434 #undef CHK_
435 }
436
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const437 ::uint8_t* MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::_InternalSerialize(
438 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
439 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
440 ::uint32_t cached_has_bits = 0;
441 (void) cached_has_bits;
442
443 cached_has_bits = _impl_._has_bits_[0];
444 // optional string name = 1;
445 if (cached_has_bits & 0x00000001u) {
446 target = stream->WriteStringMaybeAliased(
447 1, this->_internal_name(), target);
448 }
449
450 // optional .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry.Units units = 2;
451 if (cached_has_bits & 0x00000008u) {
452 target = stream->EnsureSpace(target);
453 target = ::_pbi::WireFormatLite::WriteEnumToArray(
454 2, this->_internal_units(), target);
455 }
456
457 // optional uint64 value_uint64 = 3;
458 if (cached_has_bits & 0x00000004u) {
459 target = stream->EnsureSpace(target);
460 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_value_uint64(), target);
461 }
462
463 // optional string value_string = 4;
464 if (cached_has_bits & 0x00000002u) {
465 target = stream->WriteStringMaybeAliased(
466 4, this->_internal_value_string(), target);
467 }
468
469 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
470 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
471 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
472 }
473 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
474 return target;
475 }
476
ByteSizeLong() const477 size_t MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::ByteSizeLong() const {
478 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
479 size_t total_size = 0;
480
481 ::uint32_t cached_has_bits = 0;
482 // Prevent compiler warnings about cached_has_bits being unused
483 (void) cached_has_bits;
484
485 cached_has_bits = _impl_._has_bits_[0];
486 if (cached_has_bits & 0x0000000fu) {
487 // optional string name = 1;
488 if (cached_has_bits & 0x00000001u) {
489 total_size += 1 +
490 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
491 this->_internal_name());
492 }
493
494 // optional string value_string = 4;
495 if (cached_has_bits & 0x00000002u) {
496 total_size += 1 +
497 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
498 this->_internal_value_string());
499 }
500
501 // optional uint64 value_uint64 = 3;
502 if (cached_has_bits & 0x00000004u) {
503 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_value_uint64());
504 }
505
506 // optional .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry.Units units = 2;
507 if (cached_has_bits & 0x00000008u) {
508 total_size += 1 +
509 ::_pbi::WireFormatLite::EnumSize(this->_internal_units());
510 }
511
512 }
513 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
514 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
515 }
516 int cached_size = ::_pbi::ToCachedSize(total_size);
517 SetCachedSize(cached_size);
518 return total_size;
519 }
520
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)521 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::CheckTypeAndMergeFrom(
522 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
523 MergeFrom(*::_pbi::DownCast<const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry*>(
524 &from));
525 }
526
MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry & from)527 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry& from) {
528 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry* const _this = this;
529 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
530 GOOGLE_DCHECK_NE(&from, _this);
531 ::uint32_t cached_has_bits = 0;
532 (void) cached_has_bits;
533
534 cached_has_bits = from._impl_._has_bits_[0];
535 if (cached_has_bits & 0x0000000fu) {
536 if (cached_has_bits & 0x00000001u) {
537 _this->_internal_set_name(from._internal_name());
538 }
539 if (cached_has_bits & 0x00000002u) {
540 _this->_internal_set_value_string(from._internal_value_string());
541 }
542 if (cached_has_bits & 0x00000004u) {
543 _this->_impl_.value_uint64_ = from._impl_.value_uint64_;
544 }
545 if (cached_has_bits & 0x00000008u) {
546 _this->_impl_.units_ = from._impl_.units_;
547 }
548 _this->_impl_._has_bits_[0] |= cached_has_bits;
549 }
550 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
551 }
552
CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry & from)553 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry& from) {
554 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry)
555 if (&from == this) return;
556 Clear();
557 MergeFrom(from);
558 }
559
IsInitialized() const560 bool MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::IsInitialized() const {
561 return true;
562 }
563
InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry * other)564 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry* other) {
565 using std::swap;
566 auto* lhs_arena = GetArenaForAllocation();
567 auto* rhs_arena = other->GetArenaForAllocation();
568 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
569 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
570 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
571 &_impl_.name_, lhs_arena,
572 &other->_impl_.name_, rhs_arena
573 );
574 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
575 &_impl_.value_string_, lhs_arena,
576 &other->_impl_.value_string_, rhs_arena
577 );
578 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
579 PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry, _impl_.units_)
580 + sizeof(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::_impl_.units_) // NOLINT
581 - PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry, _impl_.value_uint64_)>(
582 reinterpret_cast<char*>(&_impl_.value_uint64_),
583 reinterpret_cast<char*>(&other->_impl_.value_uint64_));
584 }
585
GetTypeName() const586 std::string MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::GetTypeName() const {
587 return "perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry";
588 }
589
590
591 // ===================================================================
592
593 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::_Internal {
594 public:
595 using HasBits = decltype(std::declval<MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>()._impl_._has_bits_);
set_has_id(HasBits * has_bits)596 static void set_has_id(HasBits* has_bits) {
597 (*has_bits)[0] |= 2u;
598 }
set_has_absolute_name(HasBits * has_bits)599 static void set_has_absolute_name(HasBits* has_bits) {
600 (*has_bits)[0] |= 1u;
601 }
set_has_weak(HasBits * has_bits)602 static void set_has_weak(HasBits* has_bits) {
603 (*has_bits)[0] |= 8u;
604 }
set_has_size_bytes(HasBits * has_bits)605 static void set_has_size_bytes(HasBits* has_bits) {
606 (*has_bits)[0] |= 4u;
607 }
608 };
609
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)610 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(::PROTOBUF_NAMESPACE_ID::Arena* arena,
611 bool is_message_owned)
612 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
613 SharedCtor(arena, is_message_owned);
614 // @@protoc_insertion_point(arena_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
615 }
MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode & from)616 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode& from)
617 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
618 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode* const _this = this; (void)_this;
619 new (&_impl_) Impl_{
620 decltype(_impl_._has_bits_){from._impl_._has_bits_}
621 , /*decltype(_impl_._cached_size_)*/{}
622 , decltype(_impl_.entries_){from._impl_.entries_}
623 , decltype(_impl_.absolute_name_){}
624 , decltype(_impl_.id_){}
625 , decltype(_impl_.size_bytes_){}
626 , decltype(_impl_.weak_){}};
627
628 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
629 _impl_.absolute_name_.InitDefault();
630 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
631 _impl_.absolute_name_.Set("", GetArenaForAllocation());
632 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
633 if (from._internal_has_absolute_name()) {
634 _this->_impl_.absolute_name_.Set(from._internal_absolute_name(),
635 _this->GetArenaForAllocation());
636 }
637 ::memcpy(&_impl_.id_, &from._impl_.id_,
638 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.weak_) -
639 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.weak_));
640 // @@protoc_insertion_point(copy_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
641 }
642
SharedCtor(::_pb::Arena * arena,bool is_message_owned)643 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::SharedCtor(
644 ::_pb::Arena* arena, bool is_message_owned) {
645 (void)arena;
646 (void)is_message_owned;
647 new (&_impl_) Impl_{
648 decltype(_impl_._has_bits_){}
649 , /*decltype(_impl_._cached_size_)*/{}
650 , decltype(_impl_.entries_){arena}
651 , decltype(_impl_.absolute_name_){}
652 , decltype(_impl_.id_){::uint64_t{0u}}
653 , decltype(_impl_.size_bytes_){::uint64_t{0u}}
654 , decltype(_impl_.weak_){false}
655 };
656 _impl_.absolute_name_.InitDefault();
657 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
658 _impl_.absolute_name_.Set("", GetArenaForAllocation());
659 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
660 }
661
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode()662 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::~MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode() {
663 // @@protoc_insertion_point(destructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
664 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
665 (void)arena;
666 return;
667 }
668 SharedDtor();
669 }
670
SharedDtor()671 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::SharedDtor() {
672 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
673 _impl_.entries_.~RepeatedPtrField();
674 _impl_.absolute_name_.Destroy();
675 }
676
SetCachedSize(int size) const677 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::SetCachedSize(int size) const {
678 _impl_._cached_size_.Set(size);
679 }
680
Clear()681 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::Clear() {
682 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
683 ::uint32_t cached_has_bits = 0;
684 // Prevent compiler warnings about cached_has_bits being unused
685 (void) cached_has_bits;
686
687 _impl_.entries_.Clear();
688 cached_has_bits = _impl_._has_bits_[0];
689 if (cached_has_bits & 0x00000001u) {
690 _impl_.absolute_name_.ClearNonDefaultToEmpty();
691 }
692 if (cached_has_bits & 0x0000000eu) {
693 ::memset(&_impl_.id_, 0, static_cast<size_t>(
694 reinterpret_cast<char*>(&_impl_.weak_) -
695 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.weak_));
696 }
697 _impl_._has_bits_.Clear();
698 _internal_metadata_.Clear<std::string>();
699 }
700
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)701 const char* MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
702 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
703 _Internal::HasBits has_bits{};
704 while (!ctx->Done(&ptr)) {
705 ::uint32_t tag;
706 ptr = ::_pbi::ReadTag(ptr, &tag);
707 switch (tag >> 3) {
708 // optional uint64 id = 1;
709 case 1:
710 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
711 _Internal::set_has_id(&has_bits);
712 _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
713 CHK_(ptr);
714 } else {
715 goto handle_unusual;
716 }
717 continue;
718 // optional string absolute_name = 2;
719 case 2:
720 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
721 auto str = _internal_mutable_absolute_name();
722 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
723 CHK_(ptr);
724 } else {
725 goto handle_unusual;
726 }
727 continue;
728 // optional bool weak = 3;
729 case 3:
730 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
731 _Internal::set_has_weak(&has_bits);
732 _impl_.weak_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
733 CHK_(ptr);
734 } else {
735 goto handle_unusual;
736 }
737 continue;
738 // optional uint64 size_bytes = 4;
739 case 4:
740 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
741 _Internal::set_has_size_bytes(&has_bits);
742 _impl_.size_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
743 CHK_(ptr);
744 } else {
745 goto handle_unusual;
746 }
747 continue;
748 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry entries = 5;
749 case 5:
750 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
751 ptr -= 1;
752 do {
753 ptr += 1;
754 ptr = ctx->ParseMessage(_internal_add_entries(), ptr);
755 CHK_(ptr);
756 if (!ctx->DataAvailable(ptr)) break;
757 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
758 } else {
759 goto handle_unusual;
760 }
761 continue;
762 default:
763 goto handle_unusual;
764 } // switch
765 handle_unusual:
766 if ((tag == 0) || ((tag & 7) == 4)) {
767 CHK_(ptr);
768 ctx->SetLastTag(tag);
769 goto message_done;
770 }
771 ptr = UnknownFieldParse(
772 tag,
773 _internal_metadata_.mutable_unknown_fields<std::string>(),
774 ptr, ctx);
775 CHK_(ptr != nullptr);
776 } // while
777 message_done:
778 _impl_._has_bits_.Or(has_bits);
779 return ptr;
780 failure:
781 ptr = nullptr;
782 goto message_done;
783 #undef CHK_
784 }
785
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const786 ::uint8_t* MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::_InternalSerialize(
787 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
788 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
789 ::uint32_t cached_has_bits = 0;
790 (void) cached_has_bits;
791
792 cached_has_bits = _impl_._has_bits_[0];
793 // optional uint64 id = 1;
794 if (cached_has_bits & 0x00000002u) {
795 target = stream->EnsureSpace(target);
796 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target);
797 }
798
799 // optional string absolute_name = 2;
800 if (cached_has_bits & 0x00000001u) {
801 target = stream->WriteStringMaybeAliased(
802 2, this->_internal_absolute_name(), target);
803 }
804
805 // optional bool weak = 3;
806 if (cached_has_bits & 0x00000008u) {
807 target = stream->EnsureSpace(target);
808 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_weak(), target);
809 }
810
811 // optional uint64 size_bytes = 4;
812 if (cached_has_bits & 0x00000004u) {
813 target = stream->EnsureSpace(target);
814 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_size_bytes(), target);
815 }
816
817 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry entries = 5;
818 for (unsigned i = 0,
819 n = static_cast<unsigned>(this->_internal_entries_size()); i < n; i++) {
820 const auto& repfield = this->_internal_entries(i);
821 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
822 InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream);
823 }
824
825 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
826 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
827 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
828 }
829 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
830 return target;
831 }
832
ByteSizeLong() const833 size_t MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::ByteSizeLong() const {
834 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
835 size_t total_size = 0;
836
837 ::uint32_t cached_has_bits = 0;
838 // Prevent compiler warnings about cached_has_bits being unused
839 (void) cached_has_bits;
840
841 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode.MemoryNodeEntry entries = 5;
842 total_size += 1UL * this->_internal_entries_size();
843 for (const auto& msg : this->_impl_.entries_) {
844 total_size +=
845 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
846 }
847
848 cached_has_bits = _impl_._has_bits_[0];
849 if (cached_has_bits & 0x0000000fu) {
850 // optional string absolute_name = 2;
851 if (cached_has_bits & 0x00000001u) {
852 total_size += 1 +
853 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
854 this->_internal_absolute_name());
855 }
856
857 // optional uint64 id = 1;
858 if (cached_has_bits & 0x00000002u) {
859 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id());
860 }
861
862 // optional uint64 size_bytes = 4;
863 if (cached_has_bits & 0x00000004u) {
864 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_size_bytes());
865 }
866
867 // optional bool weak = 3;
868 if (cached_has_bits & 0x00000008u) {
869 total_size += 1 + 1;
870 }
871
872 }
873 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
874 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
875 }
876 int cached_size = ::_pbi::ToCachedSize(total_size);
877 SetCachedSize(cached_size);
878 return total_size;
879 }
880
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)881 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::CheckTypeAndMergeFrom(
882 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
883 MergeFrom(*::_pbi::DownCast<const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode*>(
884 &from));
885 }
886
MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode & from)887 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode& from) {
888 MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode* const _this = this;
889 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
890 GOOGLE_DCHECK_NE(&from, _this);
891 ::uint32_t cached_has_bits = 0;
892 (void) cached_has_bits;
893
894 _this->_impl_.entries_.MergeFrom(from._impl_.entries_);
895 cached_has_bits = from._impl_._has_bits_[0];
896 if (cached_has_bits & 0x0000000fu) {
897 if (cached_has_bits & 0x00000001u) {
898 _this->_internal_set_absolute_name(from._internal_absolute_name());
899 }
900 if (cached_has_bits & 0x00000002u) {
901 _this->_impl_.id_ = from._impl_.id_;
902 }
903 if (cached_has_bits & 0x00000004u) {
904 _this->_impl_.size_bytes_ = from._impl_.size_bytes_;
905 }
906 if (cached_has_bits & 0x00000008u) {
907 _this->_impl_.weak_ = from._impl_.weak_;
908 }
909 _this->_impl_._has_bits_[0] |= cached_has_bits;
910 }
911 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
912 }
913
CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode & from)914 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode& from) {
915 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode)
916 if (&from == this) return;
917 Clear();
918 MergeFrom(from);
919 }
920
IsInitialized() const921 bool MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::IsInitialized() const {
922 return true;
923 }
924
InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode * other)925 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode* other) {
926 using std::swap;
927 auto* lhs_arena = GetArenaForAllocation();
928 auto* rhs_arena = other->GetArenaForAllocation();
929 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
930 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
931 _impl_.entries_.InternalSwap(&other->_impl_.entries_);
932 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
933 &_impl_.absolute_name_, lhs_arena,
934 &other->_impl_.absolute_name_, rhs_arena
935 );
936 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
937 PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode, _impl_.weak_)
938 + sizeof(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::_impl_.weak_) // NOLINT
939 - PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode, _impl_.id_)>(
940 reinterpret_cast<char*>(&_impl_.id_),
941 reinterpret_cast<char*>(&other->_impl_.id_));
942 }
943
GetTypeName() const944 std::string MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode::GetTypeName() const {
945 return "perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode";
946 }
947
948
949 // ===================================================================
950
951 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::_Internal {
952 public:
953 using HasBits = decltype(std::declval<MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge>()._impl_._has_bits_);
set_has_source_id(HasBits * has_bits)954 static void set_has_source_id(HasBits* has_bits) {
955 (*has_bits)[0] |= 1u;
956 }
set_has_target_id(HasBits * has_bits)957 static void set_has_target_id(HasBits* has_bits) {
958 (*has_bits)[0] |= 2u;
959 }
set_has_importance(HasBits * has_bits)960 static void set_has_importance(HasBits* has_bits) {
961 (*has_bits)[0] |= 4u;
962 }
set_has_overridable(HasBits * has_bits)963 static void set_has_overridable(HasBits* has_bits) {
964 (*has_bits)[0] |= 8u;
965 }
966 };
967
MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)968 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(::PROTOBUF_NAMESPACE_ID::Arena* arena,
969 bool is_message_owned)
970 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
971 SharedCtor(arena, is_message_owned);
972 // @@protoc_insertion_point(arena_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
973 }
MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge & from)974 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge& from)
975 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
976 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge* const _this = this; (void)_this;
977 new (&_impl_) Impl_{
978 decltype(_impl_._has_bits_){from._impl_._has_bits_}
979 , /*decltype(_impl_._cached_size_)*/{}
980 , decltype(_impl_.source_id_){}
981 , decltype(_impl_.target_id_){}
982 , decltype(_impl_.importance_){}
983 , decltype(_impl_.overridable_){}};
984
985 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
986 ::memcpy(&_impl_.source_id_, &from._impl_.source_id_,
987 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.overridable_) -
988 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.overridable_));
989 // @@protoc_insertion_point(copy_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
990 }
991
SharedCtor(::_pb::Arena * arena,bool is_message_owned)992 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::SharedCtor(
993 ::_pb::Arena* arena, bool is_message_owned) {
994 (void)arena;
995 (void)is_message_owned;
996 new (&_impl_) Impl_{
997 decltype(_impl_._has_bits_){}
998 , /*decltype(_impl_._cached_size_)*/{}
999 , decltype(_impl_.source_id_){::uint64_t{0u}}
1000 , decltype(_impl_.target_id_){::uint64_t{0u}}
1001 , decltype(_impl_.importance_){0u}
1002 , decltype(_impl_.overridable_){false}
1003 };
1004 }
1005
~MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge()1006 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::~MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge() {
1007 // @@protoc_insertion_point(destructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1008 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1009 (void)arena;
1010 return;
1011 }
1012 SharedDtor();
1013 }
1014
SharedDtor()1015 inline void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::SharedDtor() {
1016 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1017 }
1018
SetCachedSize(int size) const1019 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::SetCachedSize(int size) const {
1020 _impl_._cached_size_.Set(size);
1021 }
1022
Clear()1023 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::Clear() {
1024 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1025 ::uint32_t cached_has_bits = 0;
1026 // Prevent compiler warnings about cached_has_bits being unused
1027 (void) cached_has_bits;
1028
1029 cached_has_bits = _impl_._has_bits_[0];
1030 if (cached_has_bits & 0x0000000fu) {
1031 ::memset(&_impl_.source_id_, 0, static_cast<size_t>(
1032 reinterpret_cast<char*>(&_impl_.overridable_) -
1033 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.overridable_));
1034 }
1035 _impl_._has_bits_.Clear();
1036 _internal_metadata_.Clear<std::string>();
1037 }
1038
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1039 const char* MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1040 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1041 _Internal::HasBits has_bits{};
1042 while (!ctx->Done(&ptr)) {
1043 ::uint32_t tag;
1044 ptr = ::_pbi::ReadTag(ptr, &tag);
1045 switch (tag >> 3) {
1046 // optional uint64 source_id = 1;
1047 case 1:
1048 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1049 _Internal::set_has_source_id(&has_bits);
1050 _impl_.source_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1051 CHK_(ptr);
1052 } else {
1053 goto handle_unusual;
1054 }
1055 continue;
1056 // optional uint64 target_id = 2;
1057 case 2:
1058 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1059 _Internal::set_has_target_id(&has_bits);
1060 _impl_.target_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1061 CHK_(ptr);
1062 } else {
1063 goto handle_unusual;
1064 }
1065 continue;
1066 // optional uint32 importance = 3;
1067 case 3:
1068 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1069 _Internal::set_has_importance(&has_bits);
1070 _impl_.importance_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1071 CHK_(ptr);
1072 } else {
1073 goto handle_unusual;
1074 }
1075 continue;
1076 // optional bool overridable = 4;
1077 case 4:
1078 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1079 _Internal::set_has_overridable(&has_bits);
1080 _impl_.overridable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1081 CHK_(ptr);
1082 } else {
1083 goto handle_unusual;
1084 }
1085 continue;
1086 default:
1087 goto handle_unusual;
1088 } // switch
1089 handle_unusual:
1090 if ((tag == 0) || ((tag & 7) == 4)) {
1091 CHK_(ptr);
1092 ctx->SetLastTag(tag);
1093 goto message_done;
1094 }
1095 ptr = UnknownFieldParse(
1096 tag,
1097 _internal_metadata_.mutable_unknown_fields<std::string>(),
1098 ptr, ctx);
1099 CHK_(ptr != nullptr);
1100 } // while
1101 message_done:
1102 _impl_._has_bits_.Or(has_bits);
1103 return ptr;
1104 failure:
1105 ptr = nullptr;
1106 goto message_done;
1107 #undef CHK_
1108 }
1109
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1110 ::uint8_t* MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::_InternalSerialize(
1111 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1112 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1113 ::uint32_t cached_has_bits = 0;
1114 (void) cached_has_bits;
1115
1116 cached_has_bits = _impl_._has_bits_[0];
1117 // optional uint64 source_id = 1;
1118 if (cached_has_bits & 0x00000001u) {
1119 target = stream->EnsureSpace(target);
1120 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_source_id(), target);
1121 }
1122
1123 // optional uint64 target_id = 2;
1124 if (cached_has_bits & 0x00000002u) {
1125 target = stream->EnsureSpace(target);
1126 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_target_id(), target);
1127 }
1128
1129 // optional uint32 importance = 3;
1130 if (cached_has_bits & 0x00000004u) {
1131 target = stream->EnsureSpace(target);
1132 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_importance(), target);
1133 }
1134
1135 // optional bool overridable = 4;
1136 if (cached_has_bits & 0x00000008u) {
1137 target = stream->EnsureSpace(target);
1138 target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_overridable(), target);
1139 }
1140
1141 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1142 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1143 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1144 }
1145 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1146 return target;
1147 }
1148
ByteSizeLong() const1149 size_t MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::ByteSizeLong() const {
1150 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1151 size_t total_size = 0;
1152
1153 ::uint32_t cached_has_bits = 0;
1154 // Prevent compiler warnings about cached_has_bits being unused
1155 (void) cached_has_bits;
1156
1157 cached_has_bits = _impl_._has_bits_[0];
1158 if (cached_has_bits & 0x0000000fu) {
1159 // optional uint64 source_id = 1;
1160 if (cached_has_bits & 0x00000001u) {
1161 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_source_id());
1162 }
1163
1164 // optional uint64 target_id = 2;
1165 if (cached_has_bits & 0x00000002u) {
1166 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_target_id());
1167 }
1168
1169 // optional uint32 importance = 3;
1170 if (cached_has_bits & 0x00000004u) {
1171 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_importance());
1172 }
1173
1174 // optional bool overridable = 4;
1175 if (cached_has_bits & 0x00000008u) {
1176 total_size += 1 + 1;
1177 }
1178
1179 }
1180 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1181 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1182 }
1183 int cached_size = ::_pbi::ToCachedSize(total_size);
1184 SetCachedSize(cached_size);
1185 return total_size;
1186 }
1187
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1188 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::CheckTypeAndMergeFrom(
1189 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1190 MergeFrom(*::_pbi::DownCast<const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge*>(
1191 &from));
1192 }
1193
MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge & from)1194 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge& from) {
1195 MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge* const _this = this;
1196 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1197 GOOGLE_DCHECK_NE(&from, _this);
1198 ::uint32_t cached_has_bits = 0;
1199 (void) cached_has_bits;
1200
1201 cached_has_bits = from._impl_._has_bits_[0];
1202 if (cached_has_bits & 0x0000000fu) {
1203 if (cached_has_bits & 0x00000001u) {
1204 _this->_impl_.source_id_ = from._impl_.source_id_;
1205 }
1206 if (cached_has_bits & 0x00000002u) {
1207 _this->_impl_.target_id_ = from._impl_.target_id_;
1208 }
1209 if (cached_has_bits & 0x00000004u) {
1210 _this->_impl_.importance_ = from._impl_.importance_;
1211 }
1212 if (cached_has_bits & 0x00000008u) {
1213 _this->_impl_.overridable_ = from._impl_.overridable_;
1214 }
1215 _this->_impl_._has_bits_[0] |= cached_has_bits;
1216 }
1217 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1218 }
1219
CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge & from)1220 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge& from) {
1221 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge)
1222 if (&from == this) return;
1223 Clear();
1224 MergeFrom(from);
1225 }
1226
IsInitialized() const1227 bool MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::IsInitialized() const {
1228 return true;
1229 }
1230
InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge * other)1231 void MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge* other) {
1232 using std::swap;
1233 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1234 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1235 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1236 PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge, _impl_.overridable_)
1237 + sizeof(MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::_impl_.overridable_) // NOLINT
1238 - PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge, _impl_.source_id_)>(
1239 reinterpret_cast<char*>(&_impl_.source_id_),
1240 reinterpret_cast<char*>(&other->_impl_.source_id_));
1241 }
1242
GetTypeName() const1243 std::string MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge::GetTypeName() const {
1244 return "perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge";
1245 }
1246
1247
1248 // ===================================================================
1249
1250 class MemoryTrackerSnapshot_ProcessSnapshot::_Internal {
1251 public:
1252 using HasBits = decltype(std::declval<MemoryTrackerSnapshot_ProcessSnapshot>()._impl_._has_bits_);
set_has_pid(HasBits * has_bits)1253 static void set_has_pid(HasBits* has_bits) {
1254 (*has_bits)[0] |= 1u;
1255 }
1256 };
1257
MemoryTrackerSnapshot_ProcessSnapshot(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1258 MemoryTrackerSnapshot_ProcessSnapshot::MemoryTrackerSnapshot_ProcessSnapshot(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1259 bool is_message_owned)
1260 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1261 SharedCtor(arena, is_message_owned);
1262 // @@protoc_insertion_point(arena_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1263 }
MemoryTrackerSnapshot_ProcessSnapshot(const MemoryTrackerSnapshot_ProcessSnapshot & from)1264 MemoryTrackerSnapshot_ProcessSnapshot::MemoryTrackerSnapshot_ProcessSnapshot(const MemoryTrackerSnapshot_ProcessSnapshot& from)
1265 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1266 MemoryTrackerSnapshot_ProcessSnapshot* const _this = this; (void)_this;
1267 new (&_impl_) Impl_{
1268 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1269 , /*decltype(_impl_._cached_size_)*/{}
1270 , decltype(_impl_.allocator_dumps_){from._impl_.allocator_dumps_}
1271 , decltype(_impl_.memory_edges_){from._impl_.memory_edges_}
1272 , decltype(_impl_.pid_){}};
1273
1274 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1275 _this->_impl_.pid_ = from._impl_.pid_;
1276 // @@protoc_insertion_point(copy_constructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1277 }
1278
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1279 inline void MemoryTrackerSnapshot_ProcessSnapshot::SharedCtor(
1280 ::_pb::Arena* arena, bool is_message_owned) {
1281 (void)arena;
1282 (void)is_message_owned;
1283 new (&_impl_) Impl_{
1284 decltype(_impl_._has_bits_){}
1285 , /*decltype(_impl_._cached_size_)*/{}
1286 , decltype(_impl_.allocator_dumps_){arena}
1287 , decltype(_impl_.memory_edges_){arena}
1288 , decltype(_impl_.pid_){0}
1289 };
1290 }
1291
~MemoryTrackerSnapshot_ProcessSnapshot()1292 MemoryTrackerSnapshot_ProcessSnapshot::~MemoryTrackerSnapshot_ProcessSnapshot() {
1293 // @@protoc_insertion_point(destructor:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1294 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1295 (void)arena;
1296 return;
1297 }
1298 SharedDtor();
1299 }
1300
SharedDtor()1301 inline void MemoryTrackerSnapshot_ProcessSnapshot::SharedDtor() {
1302 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1303 _impl_.allocator_dumps_.~RepeatedPtrField();
1304 _impl_.memory_edges_.~RepeatedPtrField();
1305 }
1306
SetCachedSize(int size) const1307 void MemoryTrackerSnapshot_ProcessSnapshot::SetCachedSize(int size) const {
1308 _impl_._cached_size_.Set(size);
1309 }
1310
Clear()1311 void MemoryTrackerSnapshot_ProcessSnapshot::Clear() {
1312 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1313 ::uint32_t cached_has_bits = 0;
1314 // Prevent compiler warnings about cached_has_bits being unused
1315 (void) cached_has_bits;
1316
1317 _impl_.allocator_dumps_.Clear();
1318 _impl_.memory_edges_.Clear();
1319 _impl_.pid_ = 0;
1320 _impl_._has_bits_.Clear();
1321 _internal_metadata_.Clear<std::string>();
1322 }
1323
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1324 const char* MemoryTrackerSnapshot_ProcessSnapshot::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1325 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1326 _Internal::HasBits has_bits{};
1327 while (!ctx->Done(&ptr)) {
1328 ::uint32_t tag;
1329 ptr = ::_pbi::ReadTag(ptr, &tag);
1330 switch (tag >> 3) {
1331 // optional int32 pid = 1;
1332 case 1:
1333 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1334 _Internal::set_has_pid(&has_bits);
1335 _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1336 CHK_(ptr);
1337 } else {
1338 goto handle_unusual;
1339 }
1340 continue;
1341 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode allocator_dumps = 2;
1342 case 2:
1343 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1344 ptr -= 1;
1345 do {
1346 ptr += 1;
1347 ptr = ctx->ParseMessage(_internal_add_allocator_dumps(), ptr);
1348 CHK_(ptr);
1349 if (!ctx->DataAvailable(ptr)) break;
1350 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
1351 } else {
1352 goto handle_unusual;
1353 }
1354 continue;
1355 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge memory_edges = 3;
1356 case 3:
1357 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
1358 ptr -= 1;
1359 do {
1360 ptr += 1;
1361 ptr = ctx->ParseMessage(_internal_add_memory_edges(), ptr);
1362 CHK_(ptr);
1363 if (!ctx->DataAvailable(ptr)) break;
1364 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
1365 } else {
1366 goto handle_unusual;
1367 }
1368 continue;
1369 default:
1370 goto handle_unusual;
1371 } // switch
1372 handle_unusual:
1373 if ((tag == 0) || ((tag & 7) == 4)) {
1374 CHK_(ptr);
1375 ctx->SetLastTag(tag);
1376 goto message_done;
1377 }
1378 ptr = UnknownFieldParse(
1379 tag,
1380 _internal_metadata_.mutable_unknown_fields<std::string>(),
1381 ptr, ctx);
1382 CHK_(ptr != nullptr);
1383 } // while
1384 message_done:
1385 _impl_._has_bits_.Or(has_bits);
1386 return ptr;
1387 failure:
1388 ptr = nullptr;
1389 goto message_done;
1390 #undef CHK_
1391 }
1392
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1393 ::uint8_t* MemoryTrackerSnapshot_ProcessSnapshot::_InternalSerialize(
1394 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1395 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1396 ::uint32_t cached_has_bits = 0;
1397 (void) cached_has_bits;
1398
1399 cached_has_bits = _impl_._has_bits_[0];
1400 // optional int32 pid = 1;
1401 if (cached_has_bits & 0x00000001u) {
1402 target = stream->EnsureSpace(target);
1403 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_pid(), target);
1404 }
1405
1406 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode allocator_dumps = 2;
1407 for (unsigned i = 0,
1408 n = static_cast<unsigned>(this->_internal_allocator_dumps_size()); i < n; i++) {
1409 const auto& repfield = this->_internal_allocator_dumps(i);
1410 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1411 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
1412 }
1413
1414 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge memory_edges = 3;
1415 for (unsigned i = 0,
1416 n = static_cast<unsigned>(this->_internal_memory_edges_size()); i < n; i++) {
1417 const auto& repfield = this->_internal_memory_edges(i);
1418 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1419 InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
1420 }
1421
1422 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1423 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1424 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1425 }
1426 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1427 return target;
1428 }
1429
ByteSizeLong() const1430 size_t MemoryTrackerSnapshot_ProcessSnapshot::ByteSizeLong() const {
1431 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1432 size_t total_size = 0;
1433
1434 ::uint32_t cached_has_bits = 0;
1435 // Prevent compiler warnings about cached_has_bits being unused
1436 (void) cached_has_bits;
1437
1438 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryNode allocator_dumps = 2;
1439 total_size += 1UL * this->_internal_allocator_dumps_size();
1440 for (const auto& msg : this->_impl_.allocator_dumps_) {
1441 total_size +=
1442 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1443 }
1444
1445 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot.MemoryEdge memory_edges = 3;
1446 total_size += 1UL * this->_internal_memory_edges_size();
1447 for (const auto& msg : this->_impl_.memory_edges_) {
1448 total_size +=
1449 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1450 }
1451
1452 // optional int32 pid = 1;
1453 cached_has_bits = _impl_._has_bits_[0];
1454 if (cached_has_bits & 0x00000001u) {
1455 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pid());
1456 }
1457
1458 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1459 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1460 }
1461 int cached_size = ::_pbi::ToCachedSize(total_size);
1462 SetCachedSize(cached_size);
1463 return total_size;
1464 }
1465
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1466 void MemoryTrackerSnapshot_ProcessSnapshot::CheckTypeAndMergeFrom(
1467 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1468 MergeFrom(*::_pbi::DownCast<const MemoryTrackerSnapshot_ProcessSnapshot*>(
1469 &from));
1470 }
1471
MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot & from)1472 void MemoryTrackerSnapshot_ProcessSnapshot::MergeFrom(const MemoryTrackerSnapshot_ProcessSnapshot& from) {
1473 MemoryTrackerSnapshot_ProcessSnapshot* const _this = this;
1474 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1475 GOOGLE_DCHECK_NE(&from, _this);
1476 ::uint32_t cached_has_bits = 0;
1477 (void) cached_has_bits;
1478
1479 _this->_impl_.allocator_dumps_.MergeFrom(from._impl_.allocator_dumps_);
1480 _this->_impl_.memory_edges_.MergeFrom(from._impl_.memory_edges_);
1481 if (from._internal_has_pid()) {
1482 _this->_internal_set_pid(from._internal_pid());
1483 }
1484 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1485 }
1486
CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot & from)1487 void MemoryTrackerSnapshot_ProcessSnapshot::CopyFrom(const MemoryTrackerSnapshot_ProcessSnapshot& from) {
1488 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot)
1489 if (&from == this) return;
1490 Clear();
1491 MergeFrom(from);
1492 }
1493
IsInitialized() const1494 bool MemoryTrackerSnapshot_ProcessSnapshot::IsInitialized() const {
1495 return true;
1496 }
1497
InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot * other)1498 void MemoryTrackerSnapshot_ProcessSnapshot::InternalSwap(MemoryTrackerSnapshot_ProcessSnapshot* other) {
1499 using std::swap;
1500 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1501 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1502 _impl_.allocator_dumps_.InternalSwap(&other->_impl_.allocator_dumps_);
1503 _impl_.memory_edges_.InternalSwap(&other->_impl_.memory_edges_);
1504 swap(_impl_.pid_, other->_impl_.pid_);
1505 }
1506
GetTypeName() const1507 std::string MemoryTrackerSnapshot_ProcessSnapshot::GetTypeName() const {
1508 return "perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot";
1509 }
1510
1511
1512 // ===================================================================
1513
1514 class MemoryTrackerSnapshot::_Internal {
1515 public:
1516 using HasBits = decltype(std::declval<MemoryTrackerSnapshot>()._impl_._has_bits_);
set_has_global_dump_id(HasBits * has_bits)1517 static void set_has_global_dump_id(HasBits* has_bits) {
1518 (*has_bits)[0] |= 1u;
1519 }
set_has_level_of_detail(HasBits * has_bits)1520 static void set_has_level_of_detail(HasBits* has_bits) {
1521 (*has_bits)[0] |= 2u;
1522 }
1523 };
1524
MemoryTrackerSnapshot(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1525 MemoryTrackerSnapshot::MemoryTrackerSnapshot(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1526 bool is_message_owned)
1527 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1528 SharedCtor(arena, is_message_owned);
1529 // @@protoc_insertion_point(arena_constructor:perfetto.protos.MemoryTrackerSnapshot)
1530 }
MemoryTrackerSnapshot(const MemoryTrackerSnapshot & from)1531 MemoryTrackerSnapshot::MemoryTrackerSnapshot(const MemoryTrackerSnapshot& from)
1532 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1533 MemoryTrackerSnapshot* const _this = this; (void)_this;
1534 new (&_impl_) Impl_{
1535 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1536 , /*decltype(_impl_._cached_size_)*/{}
1537 , decltype(_impl_.process_memory_dumps_){from._impl_.process_memory_dumps_}
1538 , decltype(_impl_.global_dump_id_){}
1539 , decltype(_impl_.level_of_detail_){}};
1540
1541 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1542 ::memcpy(&_impl_.global_dump_id_, &from._impl_.global_dump_id_,
1543 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.level_of_detail_) -
1544 reinterpret_cast<char*>(&_impl_.global_dump_id_)) + sizeof(_impl_.level_of_detail_));
1545 // @@protoc_insertion_point(copy_constructor:perfetto.protos.MemoryTrackerSnapshot)
1546 }
1547
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1548 inline void MemoryTrackerSnapshot::SharedCtor(
1549 ::_pb::Arena* arena, bool is_message_owned) {
1550 (void)arena;
1551 (void)is_message_owned;
1552 new (&_impl_) Impl_{
1553 decltype(_impl_._has_bits_){}
1554 , /*decltype(_impl_._cached_size_)*/{}
1555 , decltype(_impl_.process_memory_dumps_){arena}
1556 , decltype(_impl_.global_dump_id_){::uint64_t{0u}}
1557 , decltype(_impl_.level_of_detail_){0}
1558 };
1559 }
1560
~MemoryTrackerSnapshot()1561 MemoryTrackerSnapshot::~MemoryTrackerSnapshot() {
1562 // @@protoc_insertion_point(destructor:perfetto.protos.MemoryTrackerSnapshot)
1563 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1564 (void)arena;
1565 return;
1566 }
1567 SharedDtor();
1568 }
1569
SharedDtor()1570 inline void MemoryTrackerSnapshot::SharedDtor() {
1571 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1572 _impl_.process_memory_dumps_.~RepeatedPtrField();
1573 }
1574
SetCachedSize(int size) const1575 void MemoryTrackerSnapshot::SetCachedSize(int size) const {
1576 _impl_._cached_size_.Set(size);
1577 }
1578
Clear()1579 void MemoryTrackerSnapshot::Clear() {
1580 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MemoryTrackerSnapshot)
1581 ::uint32_t cached_has_bits = 0;
1582 // Prevent compiler warnings about cached_has_bits being unused
1583 (void) cached_has_bits;
1584
1585 _impl_.process_memory_dumps_.Clear();
1586 cached_has_bits = _impl_._has_bits_[0];
1587 if (cached_has_bits & 0x00000003u) {
1588 ::memset(&_impl_.global_dump_id_, 0, static_cast<size_t>(
1589 reinterpret_cast<char*>(&_impl_.level_of_detail_) -
1590 reinterpret_cast<char*>(&_impl_.global_dump_id_)) + sizeof(_impl_.level_of_detail_));
1591 }
1592 _impl_._has_bits_.Clear();
1593 _internal_metadata_.Clear<std::string>();
1594 }
1595
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1596 const char* MemoryTrackerSnapshot::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1597 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1598 _Internal::HasBits has_bits{};
1599 while (!ctx->Done(&ptr)) {
1600 ::uint32_t tag;
1601 ptr = ::_pbi::ReadTag(ptr, &tag);
1602 switch (tag >> 3) {
1603 // optional uint64 global_dump_id = 1;
1604 case 1:
1605 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1606 _Internal::set_has_global_dump_id(&has_bits);
1607 _impl_.global_dump_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1608 CHK_(ptr);
1609 } else {
1610 goto handle_unusual;
1611 }
1612 continue;
1613 // optional .perfetto.protos.MemoryTrackerSnapshot.LevelOfDetail level_of_detail = 2;
1614 case 2:
1615 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1616 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1617 CHK_(ptr);
1618 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::MemoryTrackerSnapshot_LevelOfDetail_IsValid(val))) {
1619 _internal_set_level_of_detail(static_cast<::perfetto::protos::MemoryTrackerSnapshot_LevelOfDetail>(val));
1620 } else {
1621 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
1622 }
1623 } else {
1624 goto handle_unusual;
1625 }
1626 continue;
1627 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot process_memory_dumps = 3;
1628 case 3:
1629 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
1630 ptr -= 1;
1631 do {
1632 ptr += 1;
1633 ptr = ctx->ParseMessage(_internal_add_process_memory_dumps(), ptr);
1634 CHK_(ptr);
1635 if (!ctx->DataAvailable(ptr)) break;
1636 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
1637 } else {
1638 goto handle_unusual;
1639 }
1640 continue;
1641 default:
1642 goto handle_unusual;
1643 } // switch
1644 handle_unusual:
1645 if ((tag == 0) || ((tag & 7) == 4)) {
1646 CHK_(ptr);
1647 ctx->SetLastTag(tag);
1648 goto message_done;
1649 }
1650 ptr = UnknownFieldParse(
1651 tag,
1652 _internal_metadata_.mutable_unknown_fields<std::string>(),
1653 ptr, ctx);
1654 CHK_(ptr != nullptr);
1655 } // while
1656 message_done:
1657 _impl_._has_bits_.Or(has_bits);
1658 return ptr;
1659 failure:
1660 ptr = nullptr;
1661 goto message_done;
1662 #undef CHK_
1663 }
1664
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1665 ::uint8_t* MemoryTrackerSnapshot::_InternalSerialize(
1666 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1667 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MemoryTrackerSnapshot)
1668 ::uint32_t cached_has_bits = 0;
1669 (void) cached_has_bits;
1670
1671 cached_has_bits = _impl_._has_bits_[0];
1672 // optional uint64 global_dump_id = 1;
1673 if (cached_has_bits & 0x00000001u) {
1674 target = stream->EnsureSpace(target);
1675 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_global_dump_id(), target);
1676 }
1677
1678 // optional .perfetto.protos.MemoryTrackerSnapshot.LevelOfDetail level_of_detail = 2;
1679 if (cached_has_bits & 0x00000002u) {
1680 target = stream->EnsureSpace(target);
1681 target = ::_pbi::WireFormatLite::WriteEnumToArray(
1682 2, this->_internal_level_of_detail(), target);
1683 }
1684
1685 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot process_memory_dumps = 3;
1686 for (unsigned i = 0,
1687 n = static_cast<unsigned>(this->_internal_process_memory_dumps_size()); i < n; i++) {
1688 const auto& repfield = this->_internal_process_memory_dumps(i);
1689 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1690 InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
1691 }
1692
1693 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1694 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1695 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1696 }
1697 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MemoryTrackerSnapshot)
1698 return target;
1699 }
1700
ByteSizeLong() const1701 size_t MemoryTrackerSnapshot::ByteSizeLong() const {
1702 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MemoryTrackerSnapshot)
1703 size_t total_size = 0;
1704
1705 ::uint32_t cached_has_bits = 0;
1706 // Prevent compiler warnings about cached_has_bits being unused
1707 (void) cached_has_bits;
1708
1709 // repeated .perfetto.protos.MemoryTrackerSnapshot.ProcessSnapshot process_memory_dumps = 3;
1710 total_size += 1UL * this->_internal_process_memory_dumps_size();
1711 for (const auto& msg : this->_impl_.process_memory_dumps_) {
1712 total_size +=
1713 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1714 }
1715
1716 cached_has_bits = _impl_._has_bits_[0];
1717 if (cached_has_bits & 0x00000003u) {
1718 // optional uint64 global_dump_id = 1;
1719 if (cached_has_bits & 0x00000001u) {
1720 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_global_dump_id());
1721 }
1722
1723 // optional .perfetto.protos.MemoryTrackerSnapshot.LevelOfDetail level_of_detail = 2;
1724 if (cached_has_bits & 0x00000002u) {
1725 total_size += 1 +
1726 ::_pbi::WireFormatLite::EnumSize(this->_internal_level_of_detail());
1727 }
1728
1729 }
1730 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1731 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1732 }
1733 int cached_size = ::_pbi::ToCachedSize(total_size);
1734 SetCachedSize(cached_size);
1735 return total_size;
1736 }
1737
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1738 void MemoryTrackerSnapshot::CheckTypeAndMergeFrom(
1739 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1740 MergeFrom(*::_pbi::DownCast<const MemoryTrackerSnapshot*>(
1741 &from));
1742 }
1743
MergeFrom(const MemoryTrackerSnapshot & from)1744 void MemoryTrackerSnapshot::MergeFrom(const MemoryTrackerSnapshot& from) {
1745 MemoryTrackerSnapshot* const _this = this;
1746 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MemoryTrackerSnapshot)
1747 GOOGLE_DCHECK_NE(&from, _this);
1748 ::uint32_t cached_has_bits = 0;
1749 (void) cached_has_bits;
1750
1751 _this->_impl_.process_memory_dumps_.MergeFrom(from._impl_.process_memory_dumps_);
1752 cached_has_bits = from._impl_._has_bits_[0];
1753 if (cached_has_bits & 0x00000003u) {
1754 if (cached_has_bits & 0x00000001u) {
1755 _this->_impl_.global_dump_id_ = from._impl_.global_dump_id_;
1756 }
1757 if (cached_has_bits & 0x00000002u) {
1758 _this->_impl_.level_of_detail_ = from._impl_.level_of_detail_;
1759 }
1760 _this->_impl_._has_bits_[0] |= cached_has_bits;
1761 }
1762 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1763 }
1764
CopyFrom(const MemoryTrackerSnapshot & from)1765 void MemoryTrackerSnapshot::CopyFrom(const MemoryTrackerSnapshot& from) {
1766 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MemoryTrackerSnapshot)
1767 if (&from == this) return;
1768 Clear();
1769 MergeFrom(from);
1770 }
1771
IsInitialized() const1772 bool MemoryTrackerSnapshot::IsInitialized() const {
1773 return true;
1774 }
1775
InternalSwap(MemoryTrackerSnapshot * other)1776 void MemoryTrackerSnapshot::InternalSwap(MemoryTrackerSnapshot* other) {
1777 using std::swap;
1778 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1779 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1780 _impl_.process_memory_dumps_.InternalSwap(&other->_impl_.process_memory_dumps_);
1781 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1782 PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot, _impl_.level_of_detail_)
1783 + sizeof(MemoryTrackerSnapshot::_impl_.level_of_detail_) // NOLINT
1784 - PROTOBUF_FIELD_OFFSET(MemoryTrackerSnapshot, _impl_.global_dump_id_)>(
1785 reinterpret_cast<char*>(&_impl_.global_dump_id_),
1786 reinterpret_cast<char*>(&other->_impl_.global_dump_id_));
1787 }
1788
GetTypeName() const1789 std::string MemoryTrackerSnapshot::GetTypeName() const {
1790 return "perfetto.protos.MemoryTrackerSnapshot";
1791 }
1792
1793
1794 // @@protoc_insertion_point(namespace_scope)
1795 } // namespace protos
1796 } // namespace perfetto
1797 PROTOBUF_NAMESPACE_OPEN
1798 template<> PROTOBUF_NOINLINE ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry*
CreateMaybeMessage(Arena * arena)1799 Arena::CreateMaybeMessage< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry >(Arena* arena) {
1800 return Arena::CreateMessageInternal< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry >(arena);
1801 }
1802 template<> PROTOBUF_NOINLINE ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode*
CreateMaybeMessage(Arena * arena)1803 Arena::CreateMaybeMessage< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode >(Arena* arena) {
1804 return Arena::CreateMessageInternal< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode >(arena);
1805 }
1806 template<> PROTOBUF_NOINLINE ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge*
CreateMaybeMessage(Arena * arena)1807 Arena::CreateMaybeMessage< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge >(Arena* arena) {
1808 return Arena::CreateMessageInternal< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge >(arena);
1809 }
1810 template<> PROTOBUF_NOINLINE ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot*
CreateMaybeMessage(Arena * arena)1811 Arena::CreateMaybeMessage< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot >(Arena* arena) {
1812 return Arena::CreateMessageInternal< ::perfetto::protos::MemoryTrackerSnapshot_ProcessSnapshot >(arena);
1813 }
1814 template<> PROTOBUF_NOINLINE ::perfetto::protos::MemoryTrackerSnapshot*
CreateMaybeMessage(Arena * arena)1815 Arena::CreateMaybeMessage< ::perfetto::protos::MemoryTrackerSnapshot >(Arena* arena) {
1816 return Arena::CreateMessageInternal< ::perfetto::protos::MemoryTrackerSnapshot >(arena);
1817 }
1818 PROTOBUF_NAMESPACE_CLOSE
1819
1820 // @@protoc_insertion_point(global_scope)
1821 #include <google/protobuf/port_undef.inc>
1822