protobuf/src/google/protobuf/generated_message_util.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
35 #include <google/protobuf/generated_message_util.h>
36 
37 #include <atomic>
38 #include <limits>
39 #include <vector>
40 
41 #include <google/protobuf/io/coded_stream.h>
42 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
43 #include <google/protobuf/arenastring.h>
44 #include <google/protobuf/extension_set.h>
45 #include <google/protobuf/generated_message_table_driven.h>
46 #include <google/protobuf/message_lite.h>
47 #include <google/protobuf/metadata_lite.h>
48 #include <google/protobuf/repeated_field.h>
49 #include <google/protobuf/wire_format_lite.h>
50 
51 // Must be included last
52 #include <google/protobuf/port_def.inc>
53 
54 PROTOBUF_PRAGMA_INIT_SEG
55 
56 
57 namespace google {
58 namespace protobuf {
59 namespace internal {
60 
61 void DestroyMessage(const void* message) {
62  static_cast<const MessageLite*>(message)->~MessageLite();
63 }
64 void DestroyString(const void* s) {
65  static_cast<const std::string*>(s)->~basic_string();
66 }
67 
68 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
69  PROTOBUF_ATTRIBUTE_INIT_PRIORITY ExplicitlyConstructed<std::string>
70  fixed_address_empty_string{}; // NOLINT
71 
72 
73 PROTOBUF_CONSTINIT std::atomic<bool> init_protobuf_defaults_state{false};
74 static bool InitProtobufDefaultsImpl() {
77 
78 
79  init_protobuf_defaults_state.store(true, std::memory_order_release);
80  return true;
81 }
82 
84  static bool is_inited = InitProtobufDefaultsImpl();
85  (void)is_inited;
86 }
87 // Force the initialization of the empty string.
88 // Normally, registration would do it, but we don't have any guarantee that
89 // there is any object with reflection.
90 PROTOBUF_ATTRIBUTE_INIT_PRIORITY static std::true_type init_empty_string =
92 
94  const void* start = &str;
95  const void* end = &str + 1;
96  if (start <= str.data() && str.data() < end) {
97  // The string's data is stored inside the string object itself.
98  return 0;
99  } else {
100  return str.capacity();
101  }
102 }
103 
104 template <typename T>
105 const T& Get(const void* ptr) {
106  return *static_cast<const T*>(ptr);
107 }
108 
109 // PrimitiveTypeHelper is a wrapper around the interface of WireFormatLite.
110 // WireFormatLite has a very inconvenient interface with respect to template
111 // meta-programming. This class wraps the different named functions into
112 // a single Serialize / SerializeToArray interface.
113 template <int type>
114 struct PrimitiveTypeHelper;
115 
116 template <>
117 struct PrimitiveTypeHelper<WireFormatLite::TYPE_BOOL> {
118  typedef bool Type;
119  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
121  }
122  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
124  }
125 };
126 
127 template <>
128 struct PrimitiveTypeHelper<WireFormatLite::TYPE_INT32> {
129  typedef int32_t Type;
130  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
132  }
133  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
135  }
136 };
137 
138 template <>
139 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SINT32> {
140  typedef int32_t Type;
141  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
143  }
144  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
146  }
147 };
148 
149 template <>
150 struct PrimitiveTypeHelper<WireFormatLite::TYPE_UINT32> {
151  typedef uint32_t Type;
152  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
154  }
155  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
157  }
158 };
159 template <>
160 struct PrimitiveTypeHelper<WireFormatLite::TYPE_INT64> {
161  typedef int64_t Type;
162  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
164  }
165  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
167  }
168 };
169 
170 template <>
171 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SINT64> {
172  typedef int64_t Type;
173  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
175  }
176  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
178  }
179 };
180 template <>
181 struct PrimitiveTypeHelper<WireFormatLite::TYPE_UINT64> {
182  typedef uint64_t Type;
183  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
185  }
186  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
188  }
189 };
190 
191 template <>
192 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED32> {
193  typedef uint32_t Type;
194  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
196  }
197  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
199  }
200 };
201 
202 template <>
203 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED64> {
204  typedef uint64_t Type;
205  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
207  }
208  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
210  }
211 };
212 
213 template <>
214 struct PrimitiveTypeHelper<WireFormatLite::TYPE_ENUM>
215  : PrimitiveTypeHelper<WireFormatLite::TYPE_INT32> {};
216 
217 template <>
218 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SFIXED32>
219  : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED32> {
220  typedef int32_t Type;
221 };
222 template <>
223 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SFIXED64>
224  : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED64> {
225  typedef int64_t Type;
226 };
227 template <>
228 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FLOAT>
229  : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED32> {
230  typedef float Type;
231 };
232 template <>
233 struct PrimitiveTypeHelper<WireFormatLite::TYPE_DOUBLE>
234  : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED64> {
235  typedef double Type;
236 };
237 
238 template <>
239 struct PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {
240  typedef std::string Type;
241  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
242  const Type& value = *static_cast<const Type*>(ptr);
243  output->WriteVarint32(value.size());
244  output->WriteRawMaybeAliased(value.data(), value.size());
245  }
246  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
247  const Type& value = *static_cast<const Type*>(ptr);
249  }
250 };
251 
252 template <>
253 struct PrimitiveTypeHelper<WireFormatLite::TYPE_BYTES>
254  : PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {};
255 
256 
257 template <>
258 struct PrimitiveTypeHelper<FieldMetadata::kInlinedType>
259  : PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {};
260 
261 // We want to serialize to both CodedOutputStream and directly into byte arrays
262 // without duplicating the code. In fact we might want extra output channels in
263 // the future.
264 template <typename O, int type>
265 struct OutputHelper;
266 
267 template <int type, typename O>
268 void SerializeTo(const void* ptr, O* output) {
269  OutputHelper<O, type>::Serialize(ptr, output);
270 }
271 
272 template <typename O>
273 void WriteTagTo(uint32_t tag, O* output) {
274  SerializeTo<WireFormatLite::TYPE_UINT32>(&tag, output);
275 }
276 
277 template <typename O>
279  SerializeTo<WireFormatLite::TYPE_UINT32>(&length, output);
280 }
281 
282 // Specialization for coded output stream
283 template <int type>
284 struct OutputHelper<io::CodedOutputStream, type> {
285  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
287  }
288 };
289 
290 // Specialization for writing into a plain array
291 struct ArrayOutput {
293  bool is_deterministic;
294 };
295 
296 template <int type>
297 struct OutputHelper<ArrayOutput, type> {
298  static void Serialize(const void* ptr, ArrayOutput* output) {
300  }
301 };
302 
305  msg->SerializeWithCachedSizes(output);
306 }
307 
308 void SerializeMessageNoTable(const MessageLite* msg, ArrayOutput* output) {
309  io::ArrayOutputStream array_stream(output->ptr, INT_MAX);
310  io::CodedOutputStream o(&array_stream);
311  o.SetSerializationDeterministic(output->is_deterministic);
312  msg->SerializeWithCachedSizes(&o);
313  output->ptr += o.ByteCount();
314 }
315 
316 // Helper to branch to fast path if possible
318  const FieldMetadata* field_table, int num_fields,
319  int32_t /*cached_size*/,
321  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
322  SerializeInternal(base, field_table, num_fields, output);
323 }
324 
325 // Helper to branch to fast path if possible
327  const FieldMetadata* field_table, int num_fields,
328  int32_t /*cached_size*/, ArrayOutput* output) {
329  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
330  output->ptr = SerializeInternalToArray(base, field_table, num_fields,
331  output->is_deterministic, output->ptr);
332 }
333 
334 // Serializing messages is special as it's not a primitive type and needs an
335 // explicit overload for each output type.
336 template <typename O>
337 void SerializeMessageTo(const MessageLite* msg, const void* table_ptr,
338  O* output) {
339  const SerializationTable* table =
340  static_cast<const SerializationTable*>(table_ptr);
341  if (!table) {
342  // Proto1
343  WriteLengthTo(msg->GetCachedSize(), output);
345  return;
346  }
347  const FieldMetadata* field_table = table->field_table;
348  const uint8_t* base = reinterpret_cast<const uint8_t*>(msg);
349  int cached_size =
350  *reinterpret_cast<const int32_t*>(base + field_table->offset);
351  WriteLengthTo(cached_size, output);
352  int num_fields = table->num_fields - 1;
353  SerializeMessageDispatch(*msg, field_table + 1, num_fields, cached_size,
354  output);
355 }
356 
357 // Almost the same as above only it doesn't output the length field.
358 template <typename O>
359 void SerializeGroupTo(const MessageLite* msg, const void* table_ptr,
360  O* output) {
361  const SerializationTable* table =
362  static_cast<const SerializationTable*>(table_ptr);
363  if (!table) {
364  // Proto1
366  return;
367  }
368  const FieldMetadata* field_table = table->field_table;
369  const uint8_t* base = reinterpret_cast<const uint8_t*>(msg);
370  int cached_size =
371  *reinterpret_cast<const int32_t*>(base + field_table->offset);
372  int num_fields = table->num_fields - 1;
373  SerializeMessageDispatch(*msg, field_table + 1, num_fields, cached_size,
374  output);
375 }
376 
377 template <int type>
378 struct SingularFieldHelper {
379  template <typename O>
380  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
381  WriteTagTo(md.tag, output);
382  SerializeTo<type>(field, output);
383  }
384 };
385 
386 template <>
387 struct SingularFieldHelper<WireFormatLite::TYPE_STRING> {
388  template <typename O>
389  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
390  WriteTagTo(md.tag, output);
391  SerializeTo<WireFormatLite::TYPE_STRING>(&Get<ArenaStringPtr>(field).Get(),
392  output);
393  }
394 };
395 
396 template <>
397 struct SingularFieldHelper<WireFormatLite::TYPE_BYTES>
398  : SingularFieldHelper<WireFormatLite::TYPE_STRING> {};
399 
400 template <>
401 struct SingularFieldHelper<WireFormatLite::TYPE_GROUP> {
402  template <typename O>
403  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
404  WriteTagTo(md.tag, output);
405  SerializeGroupTo(Get<const MessageLite*>(field),
406  static_cast<const SerializationTable*>(md.ptr), output);
407  WriteTagTo(md.tag + 1, output);
408  }
409 };
410 
411 template <>
412 struct SingularFieldHelper<WireFormatLite::TYPE_MESSAGE> {
413  template <typename O>
414  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
415  WriteTagTo(md.tag, output);
416  SerializeMessageTo(Get<const MessageLite*>(field),
417  static_cast<const SerializationTable*>(md.ptr), output);
418  }
419 };
420 
421 template <>
422 struct SingularFieldHelper<FieldMetadata::kInlinedType> {
423  template <typename O>
424  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
425  WriteTagTo(md.tag, output);
426  SerializeTo<FieldMetadata::kInlinedType>(&Get<std::string>(field), output);
427  }
428 };
429 
430 template <int type>
431 struct RepeatedFieldHelper {
432  template <typename O>
433  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
434  typedef typename PrimitiveTypeHelper<type>::Type T;
435  const RepeatedField<T>& array = Get<RepeatedField<T> >(field);
436  for (int i = 0; i < array.size(); i++) {
437  WriteTagTo(md.tag, output);
438  SerializeTo<type>(&array[i], output);
439  }
440  }
441 };
442 
443 // We need to use a helper class to get access to the private members
444 class AccessorHelper {
445  public:
446  static int Size(const RepeatedPtrFieldBase& x) { return x.size(); }
447  static void const* Get(const RepeatedPtrFieldBase& x, int idx) {
448  return x.raw_data()[idx];
449  }
450 };
451 
452 template <>
453 struct RepeatedFieldHelper<WireFormatLite::TYPE_STRING> {
454  template <typename O>
455  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
457  Get<internal::RepeatedPtrFieldBase>(field);
458  for (int i = 0; i < AccessorHelper::Size(array); i++) {
459  WriteTagTo(md.tag, output);
460  SerializeTo<WireFormatLite::TYPE_STRING>(AccessorHelper::Get(array, i),
461  output);
462  }
463  }
464 };
465 
466 template <>
467 struct RepeatedFieldHelper<WireFormatLite::TYPE_BYTES>
468  : RepeatedFieldHelper<WireFormatLite::TYPE_STRING> {};
469 
470 template <>
471 struct RepeatedFieldHelper<WireFormatLite::TYPE_GROUP> {
472  template <typename O>
473  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
475  Get<internal::RepeatedPtrFieldBase>(field);
476  for (int i = 0; i < AccessorHelper::Size(array); i++) {
477  WriteTagTo(md.tag, output);
479  static_cast<const MessageLite*>(AccessorHelper::Get(array, i)),
480  static_cast<const SerializationTable*>(md.ptr), output);
481  WriteTagTo(md.tag + 1, output);
482  }
483  }
484 };
485 
486 template <>
487 struct RepeatedFieldHelper<WireFormatLite::TYPE_MESSAGE> {
488  template <typename O>
489  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
491  Get<internal::RepeatedPtrFieldBase>(field);
492  for (int i = 0; i < AccessorHelper::Size(array); i++) {
493  WriteTagTo(md.tag, output);
495  static_cast<const MessageLite*>(AccessorHelper::Get(array, i)),
496  md.ptr, output);
497  }
498  }
499 };
500 
501 
502 template <>
503 struct RepeatedFieldHelper<FieldMetadata::kInlinedType>
504  : RepeatedFieldHelper<WireFormatLite::TYPE_STRING> {};
505 
506 template <int type>
507 struct PackedFieldHelper {
508  template <typename O>
509  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
510  typedef typename PrimitiveTypeHelper<type>::Type T;
511  const RepeatedField<T>& array = Get<RepeatedField<T> >(field);
512  if (array.empty()) return;
513  WriteTagTo(md.tag, output);
514  int cached_size =
515  Get<int>(static_cast<const uint8_t*>(field) + sizeof(RepeatedField<T>));
516  WriteLengthTo(cached_size, output);
517  for (int i = 0; i < array.size(); i++) {
518  SerializeTo<type>(&array[i], output);
519  }
520  }
521 };
522 
523 template <>
524 struct PackedFieldHelper<WireFormatLite::TYPE_STRING> {
525  template <typename O>
526  static void Serialize(const void* /*field*/, const FieldMetadata& md,
527  O* /*output*/) {
528  GOOGLE_LOG(FATAL) << "Not implemented field number " << md.tag << " with type "
529  << md.type;
530  }
531 };
532 
533 template <>
534 struct PackedFieldHelper<WireFormatLite::TYPE_BYTES>
535  : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
536 template <>
537 struct PackedFieldHelper<WireFormatLite::TYPE_GROUP>
538  : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
539 template <>
540 struct PackedFieldHelper<WireFormatLite::TYPE_MESSAGE>
541  : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
542 template <>
543 struct PackedFieldHelper<FieldMetadata::kInlinedType>
544  : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
545 
546 template <int type>
547 struct OneOfFieldHelper {
548  template <typename O>
549  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
551  }
552 };
553 
554 
555 template <>
556 struct OneOfFieldHelper<FieldMetadata::kInlinedType> {
557  template <typename O>
558  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
560  Get<const std::string*>(field), md, output);
561  }
562 };
563 
564 void SerializeNotImplemented(int field) {
565  GOOGLE_LOG(FATAL) << "Not implemented field number " << field;
566 }
567 
568 // When switching to c++11 we should make these constexpr functions
569 #define SERIALIZE_TABLE_OP(type, type_class) \
570  ((type - 1) + static_cast<int>(type_class) * FieldMetadata::kNumTypes)
571 
573  FieldMetadata::FieldTypeClass type_class) {
574  return SERIALIZE_TABLE_OP(type, type_class);
575 }
576 
577 template <int type>
578 bool IsNull(const void* ptr) {
579  return *static_cast<const typename PrimitiveTypeHelper<type>::Type*>(ptr) ==
580  0;
581 }
582 
583 template <>
584 bool IsNull<WireFormatLite::TYPE_STRING>(const void* ptr) {
585  return static_cast<const ArenaStringPtr*>(ptr)->Get().size() == 0;
586 }
587 
588 template <>
589 bool IsNull<WireFormatLite::TYPE_BYTES>(const void* ptr) {
590  return static_cast<const ArenaStringPtr*>(ptr)->Get().size() == 0;
591 }
592 
593 template <>
594 bool IsNull<WireFormatLite::TYPE_GROUP>(const void* ptr) {
595  return Get<const MessageLite*>(ptr) == nullptr;
596 }
597 
598 template <>
599 bool IsNull<WireFormatLite::TYPE_MESSAGE>(const void* ptr) {
600  return Get<const MessageLite*>(ptr) == nullptr;
601 }
602 
603 
604 template <>
605 bool IsNull<FieldMetadata::kInlinedType>(const void* ptr) {
606  return static_cast<const std::string*>(ptr)->empty();
607 }
608 
609 #define SERIALIZERS_FOR_TYPE(type) \
610  case SERIALIZE_TABLE_OP(type, FieldMetadata::kPresence): \
611  if (!IsPresent(base, field_metadata.has_offset)) continue; \
612  SingularFieldHelper<type>::Serialize(ptr, field_metadata, output); \
613  break; \
614  case SERIALIZE_TABLE_OP(type, FieldMetadata::kNoPresence): \
615  if (IsNull<type>(ptr)) continue; \
616  SingularFieldHelper<type>::Serialize(ptr, field_metadata, output); \
617  break; \
618  case SERIALIZE_TABLE_OP(type, FieldMetadata::kRepeated): \
619  RepeatedFieldHelper<type>::Serialize(ptr, field_metadata, output); \
620  break; \
621  case SERIALIZE_TABLE_OP(type, FieldMetadata::kPacked): \
622  PackedFieldHelper<type>::Serialize(ptr, field_metadata, output); \
623  break; \
624  case SERIALIZE_TABLE_OP(type, FieldMetadata::kOneOf): \
625  if (!IsOneofPresent(base, field_metadata.has_offset, field_metadata.tag)) \
626  continue; \
627  OneOfFieldHelper<type>::Serialize(ptr, field_metadata, output); \
628  break
629 
630 void SerializeInternal(const uint8_t* base,
631  const FieldMetadata* field_metadata_table,
632  int32_t num_fields, io::CodedOutputStream* output) {
633  SpecialSerializer func = nullptr;
634  for (int i = 0; i < num_fields; i++) {
635  const FieldMetadata& field_metadata = field_metadata_table[i];
636  const uint8_t* ptr = base + field_metadata.offset;
637  switch (field_metadata.type) {
657 
658  // Special cases
660  func = reinterpret_cast<SpecialSerializer>(
661  const_cast<void*>(field_metadata.ptr));
662  func(base, field_metadata.offset, field_metadata.tag,
663  field_metadata.has_offset, output);
664  break;
665  default:
666  // __builtin_unreachable()
667  SerializeNotImplemented(field_metadata.type);
668  }
669  }
670 }
671 
673  const FieldMetadata* field_metadata_table,
674  int32_t num_fields, bool is_deterministic,
675  uint8_t* buffer) {
676  ArrayOutput array_output = {buffer, is_deterministic};
677  ArrayOutput* output = &array_output;
678  SpecialSerializer func = nullptr;
679  for (int i = 0; i < num_fields; i++) {
680  const FieldMetadata& field_metadata = field_metadata_table[i];
681  const uint8_t* ptr = base + field_metadata.offset;
682  switch (field_metadata.type) {
702  // Special cases
704  io::ArrayOutputStream array_stream(array_output.ptr, INT_MAX);
705  io::CodedOutputStream output_stream(&array_stream);
706  output_stream.SetSerializationDeterministic(is_deterministic);
707  func = reinterpret_cast<SpecialSerializer>(
708  const_cast<void*>(field_metadata.ptr));
709  func(base, field_metadata.offset, field_metadata.tag,
710  field_metadata.has_offset, &output_stream);
711  array_output.ptr += output_stream.ByteCount();
712  } break;
713  default:
714  // __builtin_unreachable()
715  SerializeNotImplemented(field_metadata.type);
716  }
717  }
718  return array_output.ptr;
719 }
720 #undef SERIALIZERS_FOR_TYPE
721 
722 void ExtensionSerializer(const MessageLite* extendee, const uint8_t* ptr,
723  uint32_t offset, uint32_t tag, uint32_t has_offset,
725  reinterpret_cast<const ExtensionSet*>(ptr + offset)
726  ->SerializeWithCachedSizes(extendee, tag, has_offset, output);
727 }
728 
730  uint32_t /*tag*/, uint32_t /*has_offset*/,
732  output->WriteString(
733  reinterpret_cast<const InternalMetadata*>(ptr + offset)
734  ->unknown_fields<std::string>(&internal::GetEmptyString));
735 }
736 
738  if (message) {
739  MessageLite* ret = message->New();
740  ret->CheckTypeAndMergeFrom(*message);
741  return ret;
742  } else {
743  return nullptr;
744  }
745 }
746 
747 void GenericSwap(MessageLite* m1, MessageLite* m2) {
748  std::unique_ptr<MessageLite> tmp(m1->New());
749  tmp->CheckTypeAndMergeFrom(*m1);
750  m1->Clear();
751  m1->CheckTypeAndMergeFrom(*m2);
752  m2->Clear();
753  m2->CheckTypeAndMergeFrom(*tmp);
754 }
755 
756 // Returns a message owned by this Arena. This may require Own()ing or
757 // duplicating the message.
759  MessageLite* submessage,
760  Arena* submessage_arena) {
761  GOOGLE_DCHECK(Arena::InternalHelper<MessageLite>::GetOwningArena(submessage) ==
762  submessage_arena);
763  GOOGLE_DCHECK(message_arena != submessage_arena);
764  GOOGLE_DCHECK_EQ(submessage_arena, nullptr);
765  if (message_arena != nullptr && submessage_arena == nullptr) {
766  message_arena->Own(submessage);
767  return submessage;
768  } else {
769  MessageLite* ret = submessage->New(message_arena);
770  ret->CheckTypeAndMergeFrom(*submessage);
771  return ret;
772  }
773 }
774 
775 } // namespace internal
776 } // namespace protobuf
777 } // namespace google
778 
779 #include <google/protobuf/port_undef.inc>
google::protobuf.internal::WireFormatLite::TYPE_MESSAGE
@ TYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:122
xds_interop_client.str
str
Definition: xds_interop_client.py:487
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
google::protobuf.internal::AccessorHelper::Size
static int Size(const RepeatedPtrFieldBase &x)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:446
Type
struct Type Type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:673
google::protobuf.internal::IsNull
bool IsNull(const void *ptr)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:567
google::protobuf.internal::ExtensionSet
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:175
google::protobuf.internal::WireFormatLite::WriteUInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1306
google::protobuf.internal::WireFormatLite::WriteSInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1310
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT64 >::Type
uint64_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:182
google::protobuf.internal::WireFormatLite::TYPE_ENUM
@ TYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:125
google::protobuf.internal::WireFormatLite::WriteSInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt32NoTagToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1396
google::protobuf.internal::FieldMetadata::FieldTypeClass
FieldTypeClass
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:96
google::protobuf.internal::Get
const T & Get(const void *ptr)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:97
google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray
static uint8 * WriteStringWithSizeToArray(const std::string &str, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.cc:947
google::protobuf.internal::OutputHelper< io::CodedOutputStream, type >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:285
google::protobuf.internal::WireFormatLite::WriteInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt32NoTagToArray(int32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1379
google::protobuf.internal::RepeatedFieldHelper< WireFormatLite::TYPE_STRING >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:455
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT64 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:173
google::protobuf.internal::InitProtobufDefaultsImpl
static bool InitProtobufDefaultsImpl()
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:74
google::protobuf.internal::WireFormatLite::TYPE_BYTES
@ TYPE_BYTES
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:123
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT64 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:183
google::protobuf.internal::OutputHelper< ArrayOutput, type >::Serialize
static void Serialize(const void *ptr, ArrayOutput *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:298
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT64 >::Type
int64_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:161
google::protobuf.internal::SerializeTo
void SerializeTo(const void *ptr, O *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:260
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED64 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:208
google::protobuf.internal::true_type
integral_constant< bool, true > true_type
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/template_util.h:89
Arena
Definition: arena.c:39
google::protobuf.internal::WireFormatLite::TYPE_UINT32
@ TYPE_UINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:124
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT32 >::Type
uint32_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:151
google::protobuf.internal::WireFormatLite::TYPE_SINT64
@ TYPE_SINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:129
google::protobuf.internal::ArrayOutput::ptr
uint8_t * ptr
Definition: protobuf/src/google/protobuf/generated_message_util.cc:292
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf.internal::OutputHelper
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:257
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED32 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:197
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf.internal::ExtensionSerializer
void ExtensionSerializer(const uint8 *ptr, uint32 offset, uint32 tag, uint32 has_offset, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:711
google::protobuf.internal::WireFormatLite::TYPE_FIXED64
@ TYPE_FIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:117
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT64 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:162
absl::FormatConversionChar::s
@ s
google::protobuf::RepeatedField< T >
google::protobuf.internal::GenericSwap
void GenericSwap(MessageLite *m1, MessageLite *m2)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:735
google::protobuf.internal::WireFormatLite::WriteBoolNoTag
static PROTOBUF_ALWAYS_INLINE void WriteBoolNoTag(bool value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1342
google::protobuf.internal::SerializeInternal
PROTOBUF_EXPORT void SerializeInternal(const uint8 *base, const FieldMetadata *table, int32 num_fields, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:619
google::protobuf.internal::WireFormatLite::WriteUInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64NoTagToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1392
google::protobuf::MessageLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:184
google::protobuf.internal::OneOfFieldHelper::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:549
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED32 >::Type
uint32_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:193
google::protobuf.internal::WireFormatLite::TYPE_STRING
@ TYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:120
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::WriteLengthTo
void WriteLengthTo(uint32 length, O *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:270
google::protobuf.internal::SerializeGroupTo
void SerializeGroupTo(const MessageLite *msg, const void *table_ptr, O *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:350
google::protobuf.internal::WireFormatLite::WriteUInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32NoTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1388
o
UnboundConversion o
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:97
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT32 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:141
google::protobuf.internal::DestroyString
void DestroyString(const void *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:67
start
static uint64_t start
Definition: benchmark-pound.c:74
google::protobuf.internal::WireFormatLite::WriteSInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt64NoTagToArray(int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1401
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT32 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:144
google::protobuf.internal::ExplicitlyConstructed::get_mutable
T * get_mutable()
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:136
google::protobuf.internal::WireFormatLite::TYPE_SFIXED64
@ TYPE_SFIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:127
google::protobuf.internal::ArrayOutput
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:283
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
google::protobuf.internal::WireFormatLite::TYPE_SFIXED32
@ TYPE_SFIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:126
SERIALIZE_TABLE_OP
#define SERIALIZE_TABLE_OP(type, type_class)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:569
google::protobuf.internal::WireFormatLite::TYPE_UINT64
@ TYPE_UINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:115
array
Definition: undname.c:101
google::protobuf.internal::WireFormatLite::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:121
google::protobuf.internal::ArrayOutput::is_deterministic
bool is_deterministic
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:285
google::protobuf.internal::WireFormatLite::WriteBoolNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolNoTagToArray(bool value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1434
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:182
google::protobuf.internal::SerializeMessageDispatch
void SerializeMessageDispatch(const MessageLite &msg, const FieldMetadata *field_table, int num_fields, int32 cached_size, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:309
google::protobuf.internal::InitProtobufDefaultsSlow
void InitProtobufDefaultsSlow()
Definition: protobuf/src/google/protobuf/generated_message_util.cc:83
grpc::protobuf::MessageLite
GRPC_CUSTOM_MESSAGELITE MessageLite
Definition: include/grpcpp/impl/codegen/config_protobuf.h:79
google::protobuf.internal::WireFormatLite::WriteSInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1314
google::protobuf.internal::PrimitiveTypeHelper
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:106
google::protobuf.internal::PackedFieldHelper< WireFormatLite::TYPE_STRING >::Serialize
static void Serialize(const void *, const FieldMetadata &md, O *)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:526
google::protobuf.internal::WireFormatLite::TYPE_FIXED32
@ TYPE_FIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:118
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED64 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:205
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::WireFormatLite::TYPE_SINT32
@ TYPE_SINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:128
google::protobuf.internal::WireFormatLite::WriteInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1298
google::protobuf.internal::StringSpaceUsedExcludingSelfLong
size_t StringSpaceUsedExcludingSelfLong(const std::string &str)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:85
google::protobuf.internal::WireFormatLite::TYPE_BOOL
@ TYPE_BOOL
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:119
google::protobuf.internal::WireFormatLite::WriteFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32NoTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1406
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_STRING >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:241
google::protobuf.internal::FieldMetadata::type
uint32 type
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:90
google::protobuf.internal::FieldMetadata::kSpecial
@ kSpecial
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:111
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
io
google::protobuf.internal::SingularFieldHelper< FieldMetadata::kInlinedType >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:424
gen_synthetic_protos.base
base
Definition: gen_synthetic_protos.py:31
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_STRING >::Type
std::string Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:240
grpc::protobuf::io::CodedOutputStream
GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream
Definition: src/compiler/config.h:55
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_BOOL >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:122
google::protobuf.internal::GetOwnedMessageInternal
MessageLite * GetOwnedMessageInternal(Arena *message_arena, MessageLite *submessage, Arena *submessage_arena)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:746
google::protobuf.internal::OnShutdownDestroyString
void OnShutdownDestroyString(const std::string *ptr)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.h:244
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT32 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:155
setup.idx
idx
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:197
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google_benchmark.example.empty
def empty(state)
Definition: example.py:31
google::protobuf.internal::DuplicateIfNonNullInternal
MessageLite * DuplicateIfNonNullInternal(MessageLite *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:725
google::protobuf.internal::SingularFieldHelper::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:380
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED32 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:194
google::protobuf.internal::SerializeInternalToArray
uint8 * SerializeInternalToArray(const uint8 *base, const FieldMetadata *table, int32 num_fields, bool is_deterministic, uint8 *buffer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:661
google::protobuf::io::CodedOutputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1044
google::protobuf.internal::WireFormatLite::TYPE_FLOAT
@ TYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:113
google::protobuf.internal::WireFormatLite::WriteInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1294
google::protobuf.internal::SingularFieldHelper< WireFormatLite::TYPE_STRING >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:389
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_BOOL >::Type
bool Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:118
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT32 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:152
benchmark.md
md
Definition: benchmark.py:86
google::protobuf.internal::ExplicitlyConstructed::DefaultConstruct
void DefaultConstruct()
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:126
google::protobuf.internal::SerializeMessageTo
void SerializeMessageTo(const MessageLite *msg, const void *table_ptr, O *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:329
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SFIXED32 >::Type
int32_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:220
google::protobuf.internal::WireFormatLite::WriteFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1322
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SFIXED64 >::Type
int64_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:225
google::protobuf.internal::WireFormatLite::TYPE_DOUBLE
@ TYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:112
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
func
const EVP_CIPHER *(* func)(void)
Definition: cipher_extra.c:73
google::protobuf.internal::PackedFieldHelper::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:509
google::protobuf.internal::SpecialSerializer
void(* SpecialSerializer)(const uint8 *base, uint32 offset, uint32 tag, uint32 has_offset, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.h:132
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT32 >::Type
int32_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:129
google::protobuf.internal::DestroyMessage
void DestroyMessage(const void *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:64
google::protobuf.internal::init_protobuf_defaults_state
PROTOBUF_CONSTINIT std::atomic< bool > init_protobuf_defaults_state
Definition: protobuf/src/google/protobuf/generated_message_util.cc:73
google::protobuf.internal::SerializationTable
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:234
google::protobuf.internal::SingularFieldHelper< WireFormatLite::TYPE_MESSAGE >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:414
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
google::protobuf.internal::init_empty_string
static PROTOBUF_ATTRIBUTE_INIT_PRIORITY std::true_type init_empty_string
Definition: protobuf/src/google/protobuf/generated_message_util.cc:90
google::protobuf.internal::fixed_address_empty_string
ExplicitlyConstructed< std::string > fixed_address_empty_string
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:71
google::protobuf.internal::WriteTagTo
void WriteTagTo(uint32 tag, O *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:265
google::protobuf.internal::FieldMetadata::kInlinedType
@ kInlinedType
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:109
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT32 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:133
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT64 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:165
google::protobuf.internal::GetEmptyString
const PROTOBUF_EXPORT std::string & GetEmptyString()
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.h:87
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT32 >::Type
int32_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:140
google::protobuf.internal::RepeatedFieldHelper< WireFormatLite::TYPE_GROUP >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:473
google::protobuf.internal::AccessorHelper::Get
static void const * Get(const RepeatedPtrFieldBase &x, int idx)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:447
google::protobuf.internal::SerializeNotImplemented
void SerializeNotImplemented(int field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:553
google::protobuf.internal::WireFormatLite::WriteInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt64NoTagToArray(int64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1383
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf.internal::RepeatedFieldHelper< WireFormatLite::TYPE_MESSAGE >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:489
google::protobuf.internal::RepeatedPtrFieldBase
Definition: bloaty/third_party/protobuf/src/google/protobuf/repeated_field.h:451
google::protobuf.internal::WireFormatLite::TYPE_INT32
@ TYPE_INT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:116
google::protobuf.internal::OneOfFieldHelper< FieldMetadata::kInlinedType >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:558
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_INT32 >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:130
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FLOAT >::Type
float Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:230
google::protobuf.internal::WireFormatLite::WriteFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1318
google::protobuf.internal::RepeatedFieldHelper::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:433
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT64 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:176
internal
Definition: benchmark/test/output_test_helper.cc:20
table
uint8_t table[256]
Definition: hpack_parser.cc:456
google::protobuf.internal::WireFormatLite::TYPE_INT64
@ TYPE_INT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:114
google::protobuf.internal::FieldMetadata
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_table_driven.h:83
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_SINT64 >::Type
int64_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:172
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
google::protobuf.internal::FieldMetadata::CalculateType
static int CalculateType(int fundamental_type, FieldTypeClass type_class)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:561
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_STRING >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:246
google::protobuf.internal::WireFormatLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:84
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
google::protobuf.internal::SerializeMessageNoTable
void SerializeMessageNoTable(const MessageLite *msg, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:295
google::protobuf.internal::UnknownFieldSerializerLite
void UnknownFieldSerializerLite(const uint8 *ptr, uint32 offset, uint32 tag, uint32 has_offset, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:717
google::protobuf.internal::WireFormatLite::WriteUInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1302
google::protobuf.internal::WireFormatLite::WriteFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64NoTagToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1410
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_DOUBLE >::Type
double Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:235
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_UINT64 >::SerializeToArray
static uint8_t * SerializeToArray(const void *ptr, uint8_t *buffer)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:186
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_FIXED64 >::Type
uint64_t Type
Definition: protobuf/src/google/protobuf/generated_message_util.cc:204
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
offset
voidpf uLong offset
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:142
google::protobuf.internal::SingularFieldHelper< WireFormatLite::TYPE_GROUP >::Serialize
static void Serialize(const void *field, const FieldMetadata &md, O *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:403
google::protobuf.internal::PrimitiveTypeHelper< WireFormatLite::TYPE_BOOL >::Serialize
static void Serialize(const void *ptr, io::CodedOutputStream *output)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:119
SERIALIZERS_FOR_TYPE
#define SERIALIZERS_FOR_TYPE(type)
Definition: protobuf/src/google/protobuf/generated_message_util.cc:609


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:26