protobuf/src/google/protobuf/extension_set_heavy.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 // Contains methods defined in extension_set.h which cannot be part of the
36 // lite library because they use descriptors or reflection.
37 
38 #include <google/protobuf/stubs/casts.h>
39 #include <google/protobuf/descriptor.pb.h>
40 #include <google/protobuf/extension_set_inl.h>
41 #include <google/protobuf/parse_context.h>
42 #include <google/protobuf/io/coded_stream.h>
43 #include <google/protobuf/arena.h>
44 #include <google/protobuf/descriptor.h>
45 #include <google/protobuf/extension_set.h>
46 #include <google/protobuf/message.h>
47 #include <google/protobuf/message_lite.h>
48 #include <google/protobuf/repeated_field.h>
49 #include <google/protobuf/unknown_field_set.h>
50 #include <google/protobuf/wire_format.h>
51 #include <google/protobuf/wire_format_lite.h>
52 
53 
54 #include <google/protobuf/port_def.inc>
55 
56 namespace google {
57 namespace protobuf {
58 namespace internal {
59 
60 // A FieldSkipper used to store unknown MessageSet fields into UnknownFieldSet.
61 class MessageSetFieldSkipper : public UnknownFieldSetFieldSkipper {
62  public:
63  explicit MessageSetFieldSkipper(UnknownFieldSet* unknown_fields)
64  : UnknownFieldSetFieldSkipper(unknown_fields) {}
66 
68  int field_number);
69 };
71  int field_number) {
73  if (!input->ReadVarint32(&length)) return false;
74  if (unknown_fields_ == nullptr) {
75  return input->Skip(length);
76  } else {
77  return input->ReadString(unknown_fields_->AddLengthDelimited(field_number),
78  length);
79  }
80 }
81 
82 
83 // Implementation of ExtensionFinder which finds extensions in a given
84 // DescriptorPool, using the given MessageFactory to construct sub-objects.
85 // This class is implemented in extension_set_heavy.cc.
86 class DescriptorPoolExtensionFinder : public ExtensionFinder {
87  public:
89  MessageFactory* factory,
93 
94  bool Find(int number, ExtensionInfo* output) override;
95 
96  private:
97  const DescriptorPool* pool_;
100 };
101 
104  std::vector<const FieldDescriptor*>* output) const {
105  ForEach([containing_type, pool, &output](int number, const Extension& ext) {
106  bool has = false;
107  if (ext.is_repeated) {
108  has = ext.GetSize() > 0;
109  } else {
110  has = !ext.is_cleared;
111  }
112 
113  if (has) {
114  // TODO(kenton): Looking up each field by number is somewhat unfortunate.
115  // Is there a better way? The problem is that descriptors are lazily-
116  // initialized, so they might not even be constructed until
117  // AppendToList() is called.
118 
119  if (ext.descriptor == nullptr) {
120  output->push_back(pool->FindExtensionByNumber(containing_type, number));
121  } else {
122  output->push_back(ext.descriptor);
123  }
124  }
125  });
126 }
127 
130  return static_cast<FieldDescriptor::Type>(type);
131 }
132 
135  static_cast<FieldDescriptor::Type>(type));
136 }
137 
140  return static_cast<WireFormatLite::FieldType>(type);
141 }
142 
143 #define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE) \
144  GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? FieldDescriptor::LABEL_REPEATED \
145  : FieldDescriptor::LABEL_OPTIONAL, \
146  FieldDescriptor::LABEL_##LABEL); \
147  GOOGLE_DCHECK_EQ(cpp_type((EXTENSION).type), FieldDescriptor::CPPTYPE_##CPPTYPE)
148 
150  const Descriptor* message_type,
151  MessageFactory* factory) const {
152  const Extension* extension = FindOrNull(number);
153  if (extension == nullptr || extension->is_cleared) {
154  // Not present. Return the default value.
155  return *factory->GetPrototype(message_type);
156  } else {
157  GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
158  if (extension->is_lazy) {
159  return extension->lazymessage_value->GetMessage(
160  *factory->GetPrototype(message_type), arena_);
161  } else {
162  return *extension->message_value;
163  }
164  }
165 }
166 
168  MessageFactory* factory) {
169  Extension* extension;
170  if (MaybeNewExtension(descriptor->number(), descriptor, &extension)) {
171  extension->type = descriptor->type();
173  extension->is_repeated = false;
174  extension->is_packed = false;
175  const MessageLite* prototype =
176  factory->GetPrototype(descriptor->message_type());
177  extension->is_lazy = false;
178  extension->message_value = prototype->New(arena_);
179  extension->is_cleared = false;
180  return extension->message_value;
181  } else {
182  GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
183  extension->is_cleared = false;
184  if (extension->is_lazy) {
185  return extension->lazymessage_value->MutableMessage(
186  *factory->GetPrototype(descriptor->message_type()), arena_);
187  } else {
188  return extension->message_value;
189  }
190  }
191 }
192 
194  MessageFactory* factory) {
195  Extension* extension = FindOrNull(descriptor->number());
196  if (extension == nullptr) {
197  // Not present. Return nullptr.
198  return nullptr;
199  } else {
200  GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
201  MessageLite* ret = nullptr;
202  if (extension->is_lazy) {
203  ret = extension->lazymessage_value->ReleaseMessage(
204  *factory->GetPrototype(descriptor->message_type()), arena_);
205  if (arena_ == nullptr) {
206  delete extension->lazymessage_value;
207  }
208  } else {
209  if (arena_ != nullptr) {
210  ret = extension->message_value->New();
211  ret->CheckTypeAndMergeFrom(*extension->message_value);
212  } else {
213  ret = extension->message_value;
214  }
215  }
216  Erase(descriptor->number());
217  return ret;
218  }
219 }
220 
222  const FieldDescriptor* descriptor, MessageFactory* factory) {
223  Extension* extension = FindOrNull(descriptor->number());
224  if (extension == nullptr) {
225  // Not present. Return nullptr.
226  return nullptr;
227  } else {
228  GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
229  MessageLite* ret = nullptr;
230  if (extension->is_lazy) {
231  ret = extension->lazymessage_value->UnsafeArenaReleaseMessage(
232  *factory->GetPrototype(descriptor->message_type()), arena_);
233  if (arena_ == nullptr) {
234  delete extension->lazymessage_value;
235  }
236  } else {
237  ret = extension->message_value;
238  }
239  Erase(descriptor->number());
240  return ret;
241  }
242 }
243 
244 ExtensionSet::Extension* ExtensionSet::MaybeNewRepeatedExtension(
245  const FieldDescriptor* descriptor) {
246  Extension* extension;
247  if (MaybeNewExtension(descriptor->number(), descriptor, &extension)) {
248  extension->type = descriptor->type();
250  extension->is_repeated = true;
251  extension->repeated_message_value =
252  Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
253  } else {
254  GOOGLE_DCHECK_TYPE(*extension, REPEATED, MESSAGE);
255  }
256  return extension;
257 }
258 
260  MessageFactory* factory) {
262 
263  // RepeatedPtrField<Message> does not know how to Add() since it cannot
264  // allocate an abstract object, so we have to be tricky.
266  reinterpret_cast<internal::RepeatedPtrFieldBase*>(
267  extension->repeated_message_value)
268  ->AddFromCleared<GenericTypeHandler<MessageLite> >();
269  if (result == nullptr) {
270  const MessageLite* prototype;
271  if (extension->repeated_message_value->empty()) {
272  prototype = factory->GetPrototype(descriptor->message_type());
273  GOOGLE_CHECK(prototype != nullptr);
274  } else {
275  prototype = &extension->repeated_message_value->Get(0);
276  }
277  result = prototype->New(arena_);
278  extension->repeated_message_value->AddAllocated(result);
279  }
280  return result;
281 }
282 
284  MessageLite* new_entry) {
286 
287  extension->repeated_message_value->AddAllocated(new_entry);
288 }
289 
291  const FieldDescriptor* descriptor, MessageLite* new_entry) {
293 
294  extension->repeated_message_value->UnsafeArenaAddAllocated(new_entry);
295 }
296 
297 static bool ValidateEnumUsingDescriptor(const void* arg, int number) {
298  return reinterpret_cast<const EnumDescriptor*>(arg)->FindValueByNumber(
299  number) != nullptr;
300 }
301 
302 bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
303  const FieldDescriptor* extension =
305  if (extension == nullptr) {
306  return false;
307  } else {
308  output->type = extension->type();
309  output->is_repeated = extension->is_repeated();
310  output->is_packed = extension->options().packed();
311  output->descriptor = extension;
312  if (extension->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
313  output->message_info.prototype =
314  factory_->GetPrototype(extension->message_type());
315  GOOGLE_CHECK(output->message_info.prototype != nullptr)
316  << "Extension factory's GetPrototype() returned nullptr; extension: "
317  << extension->full_name();
318  } else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
319  output->enum_validity_check.func = ValidateEnumUsingDescriptor;
320  output->enum_validity_check.arg = extension->enum_type();
321  }
322 
323  return true;
324  }
325 }
326 
327 
328 bool ExtensionSet::FindExtension(int wire_type, uint32_t field,
329  const Message* containing_type,
330  const internal::ParseContext* ctx,
331  ExtensionInfo* extension,
332  bool* was_packed_on_wire) {
333  if (ctx->data().pool == nullptr) {
334  GeneratedExtensionFinder finder(containing_type);
335  if (!FindExtensionInfoFromFieldNumber(wire_type, field, &finder, extension,
336  was_packed_on_wire)) {
337  return false;
338  }
339  } else {
340  DescriptorPoolExtensionFinder finder(ctx->data().pool, ctx->data().factory,
341  containing_type->GetDescriptor());
342  if (!FindExtensionInfoFromFieldNumber(wire_type, field, &finder, extension,
343  was_packed_on_wire)) {
344  return false;
345  }
346  }
347  return true;
348 }
349 
350 const char* ExtensionSet::ParseField(uint64_t tag, const char* ptr,
351  const Message* containing_type,
354  int number = tag >> 3;
355  bool was_packed_on_wire;
358  &was_packed_on_wire)) {
359  return UnknownFieldParse(
360  tag, metadata->mutable_unknown_fields<UnknownFieldSet>(), ptr, ctx);
361  }
362  return ParseFieldWithExtensionInfo<UnknownFieldSet>(
363  number, was_packed_on_wire, extension, metadata, ptr, ctx);
364 }
365 
367  uint64_t tag, const char* ptr, const Message* containing_type,
370 }
371 
373  const char* ptr, const Message* containing_type,
375  return ParseMessageSetItemTmpl<Message, UnknownFieldSet>(ptr, containing_type,
376  metadata, ctx);
377 }
378 
380  const Message* containing_type,
381  UnknownFieldSet* unknown_fields) {
382  UnknownFieldSetFieldSkipper skipper(unknown_fields);
383  if (input->GetExtensionPool() == nullptr) {
385  return ParseField(tag, input, &finder, &skipper);
386  } else {
387  DescriptorPoolExtensionFinder finder(input->GetExtensionPool(),
388  input->GetExtensionFactory(),
389  containing_type->GetDescriptor());
390  return ParseField(tag, input, &finder, &skipper);
391  }
392 }
393 
395  const Message* containing_type,
396  UnknownFieldSet* unknown_fields) {
397  MessageSetFieldSkipper skipper(unknown_fields);
398  if (input->GetExtensionPool() == nullptr) {
399  GeneratedExtensionFinder finder(containing_type);
400  return ParseMessageSet(input, &finder, &skipper);
401  } else {
402  DescriptorPoolExtensionFinder finder(input->GetExtensionPool(),
403  input->GetExtensionFactory(),
404  containing_type->GetDescriptor());
405  return ParseMessageSet(input, &finder, &skipper);
406  }
407 }
408 
411 }
412 
414  size_t total_size = Size() * sizeof(KeyValue);
415  ForEach([&total_size](int /* number */, const Extension& ext) {
416  total_size += ext.SpaceUsedExcludingSelfLong();
417  });
418  return total_size;
419 }
420 
422  RepeatedPtrFieldBase* field) {
423  return field->SpaceUsedExcludingSelfLong<GenericTypeHandler<Message> >();
424 }
425 
427  size_t total_size = 0;
428  if (is_repeated) {
429  switch (cpp_type(type)) {
430 #define HANDLE_TYPE(UPPERCASE, LOWERCASE) \
431  case FieldDescriptor::CPPTYPE_##UPPERCASE: \
432  total_size += sizeof(*repeated_##LOWERCASE##_value) + \
433  repeated_##LOWERCASE##_value->SpaceUsedExcludingSelfLong(); \
434  break
435 
436  HANDLE_TYPE(INT32, int32_t);
437  HANDLE_TYPE(INT64, int64_t);
438  HANDLE_TYPE(UINT32, uint32_t);
439  HANDLE_TYPE(UINT64, uint64_t);
440  HANDLE_TYPE(FLOAT, float);
441  HANDLE_TYPE(DOUBLE, double);
442  HANDLE_TYPE(BOOL, bool);
443  HANDLE_TYPE(ENUM, enum);
444  HANDLE_TYPE(STRING, string);
445 #undef HANDLE_TYPE
446 
448  // repeated_message_value is actually a RepeatedPtrField<MessageLite>,
449  // but MessageLite has no SpaceUsedLong(), so we must directly call
450  // RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() with a different
451  // type handler.
452  total_size += sizeof(*repeated_message_value) +
454  reinterpret_cast<internal::RepeatedPtrFieldBase*>(
456  break;
457  }
458  } else {
459  switch (cpp_type(type)) {
461  total_size += sizeof(*string_value) +
463  break;
465  if (is_lazy) {
466  total_size += lazymessage_value->SpaceUsedLong();
467  } else {
468  total_size += down_cast<Message*>(message_value)->SpaceUsedLong();
469  }
470  break;
471  default:
472  // No extra storage costs for primitive types.
473  break;
474  }
475  }
476  return total_size;
477 }
478 
480  const MessageLite* extendee, uint8_t* target) const {
485  &stream);
486 }
487 
489  int wire_type, int field_number, io::CodedInputStream* input,
490  ExtensionFinder* extension_finder, MessageSetFieldSkipper* field_skipper) {
491  return ParseField(
492  WireFormatLite::MakeTag(field_number,
493  static_cast<WireFormatLite::WireType>(wire_type)),
494  input, extension_finder, field_skipper);
495 }
496 
498  ExtensionFinder* extension_finder,
499  MessageSetFieldSkipper* field_skipper) {
500  while (true) {
501  const uint32_t tag = input->ReadTag();
502  switch (tag) {
503  case 0:
504  return true;
506  if (!ParseMessageSetItem(input, extension_finder, field_skipper)) {
507  return false;
508  }
509  break;
510  default:
511  if (!ParseField(tag, input, extension_finder, field_skipper)) {
512  return false;
513  }
514  break;
515  }
516  }
517 }
518 
520  ExtensionFinder* extension_finder,
521  MessageSetFieldSkipper* field_skipper) {
522  struct MSFull {
523  bool ParseField(int type_id, io::CodedInputStream* input) {
524  return me->ParseFieldMaybeLazily(
526  extension_finder, field_skipper);
527  }
528 
530  return field_skipper->SkipField(input, tag);
531  }
532 
533  ExtensionSet* me;
534  ExtensionFinder* extension_finder;
535  MessageSetFieldSkipper* field_skipper;
536  };
537 
539  MSFull{this, extension_finder, field_skipper});
540 }
541 
542 } // namespace internal
543 } // namespace protobuf
544 } // namespace google
545 
546 #include <google/protobuf/port_undef.inc>
google::protobuf::FieldDescriptor::Type
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:521
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
google::protobuf.internal::ExtensionSet::Extension::is_repeated
bool is_repeated
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:580
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf.internal::DescriptorPoolExtensionFinder::Find
bool Find(int number, ExtensionInfo *output) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:295
google::protobuf.internal::ExtensionSet::MaybeNewExtension
bool MaybeNewExtension(int number, const FieldDescriptor *descriptor, Extension **result)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1507
MESSAGE
static const char MESSAGE[]
Definition: test-callback-stack.c:31
google::protobuf.internal::FieldType
uint8 FieldType
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:83
google::protobuf::EnumValueDescriptor::type
const EnumDescriptor * type() const
google::protobuf::EnumValueDescriptor::options
const EnumValueOptions & options() const
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
ctx
Definition: benchmark-async.c:30
metadata
Definition: cq_verifier.cc:48
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
google::protobuf::extension
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2001
google::protobuf.internal::ExtensionSet::Extension::message_value
MessageLite * message_value
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:564
google::protobuf.internal::ExtensionSet::SpaceUsedExcludingSelfLong
size_t SpaceUsedExcludingSelfLong() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:406
google::protobuf.internal::real_type
FieldDescriptor::Type real_type(FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:128
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
phone_pb2.message_type
message_type
Definition: phone_pb2.py:200
ext
void * ext
Definition: x509v3.h:87
google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic
static bool IsDefaultSerializationDeterministic()
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1232
google::protobuf.internal::UnknownFieldParse
const char * UnknownFieldParse(uint32 tag, std::string *unknown, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:606
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:104
google::protobuf.internal::ExtensionSet::Size
size_t Size() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:673
google::protobuf.internal::ParseContext
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:336
google::protobuf.internal::ExtensionSet::FindOrNull
const Extension * FindOrNull(int key) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1797
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::MessageFactory::GetPrototype
virtual const Message * GetPrototype(const Descriptor *type)=0
google::protobuf.internal::FromIntSize
size_t FromIntSize(int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:97
google::protobuf::MessageLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:184
GOOGLE_DCHECK_TYPE
#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:143
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf.internal::ExtensionSet::Erase
void Erase(int key)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1900
google::protobuf.internal::ExtensionSet::ReleaseMessage
MessageLite * ReleaseMessage(int number, const MessageLite &prototype)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:694
google::protobuf::HANDLE_TYPE
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
google::protobuf::python::cmessage::UnknownFieldSet
static PyObject * UnknownFieldSet(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2512
google::protobuf::MessageFactory
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:1066
google::protobuf.internal::DescriptorPoolExtensionFinder::containing_type_
const Descriptor * containing_type_
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:99
google::protobuf.internal::MessageSetFieldSkipper::SkipMessageSetField
virtual bool SkipMessageSetField(io::CodedInputStream *input, int field_number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:70
BOOL
int BOOL
Definition: undname.c:46
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
google::protobuf.internal::DescriptorPoolExtensionFinder::factory_
MessageFactory * factory_
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:98
google::protobuf.internal::ExtensionSet::SpaceUsedExcludingSelf
int SpaceUsedExcludingSelf() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:402
google::protobuf.internal::WireFormatLite::MAX_FIELD_TYPE
@ MAX_FIELD_TYPE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:130
google::protobuf.internal::ExtensionSet::Extension::lazymessage_value
LazyMessageExtension * lazymessage_value
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:565
google::protobuf.internal::ExtensionSet::ParseMessageSet
const char * ParseMessageSet(const char *ptr, const Msg *containing_type, Metadata *metadata, internal::ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:408
google::protobuf.internal::WireFormatLite::MakeTag
constexpr static uint32 MakeTag(int field_number, WireType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:783
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf.internal::ExtensionSet::ExtensionSet
ExtensionSet()
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:195
google::protobuf.internal::ValidateEnumUsingDescriptor
static bool ValidateEnumUsingDescriptor(const void *arg, int number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:290
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::io::EpsCopyOutputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:651
google::protobuf.internal::ExtensionSet::SerializeMessageSetWithCachedSizesToArray
uint8 * SerializeMessageSetWithCachedSizesToArray(uint8 *target) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:472
google::protobuf.internal::ExtensionSet::Extension::is_lazy
bool is_lazy
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:595
google::protobuf.internal::GeneratedExtensionFinder
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:145
google::protobuf.internal::ExtensionSet::AppendToList
void AppendToList(const Descriptor *containing_type, const DescriptorPool *pool, std::vector< const FieldDescriptor * > *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:102
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
google::protobuf.internal::ExtensionSet::Extension::repeated_message_value
RepeatedPtrField< MessageLite > * repeated_message_value
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:576
google::protobuf.internal::field_type
WireFormatLite::FieldType field_type(FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:138
google::protobuf.internal::ExtensionSet::Extension::type
FieldType type
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:579
google::protobuf.internal::ExtensionSet::MutableMessage
MessageLite * MutableMessage(int number, FieldType type, const MessageLite &prototype, desc)
google::protobuf.internal::ExtensionSet::arena_
Arena * arena_
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:833
google::protobuf.internal::ExtensionSet::ForEach
static KeyValueFunctor ForEach(Iterator begin, Iterator end, KeyValueFunctor func)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:681
grpc::protobuf::MessageLite
GRPC_CUSTOM_MESSAGELITE MessageLite
Definition: include/grpcpp/impl/codegen/config_protobuf.h:79
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::ParseMessageSetItemImpl
bool ParseMessageSetItemImpl(io::CodedInputStream *input, MS ms)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1808
google::protobuf.internal::ExtensionInfo
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:101
google::protobuf.internal::StringSpaceUsedExcludingSelfLong
size_t StringSpaceUsedExcludingSelfLong(const std::string &str)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:85
grpc::protobuf::io::CodedInputStream
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:102
google::protobuf::DescriptorPool
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1539
google::protobuf.internal::InternalMetadata
Definition: protobuf/src/google/protobuf/metadata_lite.h:62
arg
Definition: cmdline.cc:40
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf.internal::WireFormatLite::kMessageSetItemStartTag
static const int kMessageSetItemStartTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:215
google::protobuf.internal::WireFormatLite::FieldType
FieldType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:111
google::protobuf.internal::ExtensionSet::FindExtension
bool FindExtension(int wire_type, uint32 field, const MessageLite *containing_type, const internal::ParseContext *ctx, ExtensionInfo *extension, bool *was_packed_on_wire)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:761
phone_pb2.containing_type
containing_type
Definition: phone_pb2.py:199
google::protobuf.internal::MessageSetFieldSkipper::MessageSetFieldSkipper
MessageSetFieldSkipper(UnknownFieldSet *unknown_fields)
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:63
google::protobuf.internal::ExtensionSet::AddAllocatedMessage
void AddAllocatedMessage(const FieldDescriptor *descriptor, MessageLite *new_entry)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:283
google::protobuf.internal::ExtensionFinder
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:135
google::protobuf::UnknownFieldSet::AddLengthDelimited
void AddLengthDelimited(int number, const std::string &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:318
google::protobuf.internal::ExtensionSet::RepeatedMessage_SpaceUsedExcludingSelfLong
static size_t RepeatedMessage_SpaceUsedExcludingSelfLong(RepeatedPtrFieldBase *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:414
google::protobuf.internal::UnknownFieldSetFieldSkipper
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:293
google::protobuf.internal::ExtensionSet::InternalSerializeMessageSetWithCachedSizesToArray
uint8 * InternalSerializeMessageSetWithCachedSizesToArray(uint8 *target, io::EpsCopyOutputStream *stream) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1487
google::protobuf.internal::ExtensionSet::LazyMessageExtension::SpaceUsedLong
virtual size_t SpaceUsedLong() const =0
google::protobuf::DescriptorPool::FindExtensionByNumber
const FieldDescriptor * FindExtensionByNumber(const Descriptor *extendee, int number) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:1468
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
google::protobuf.internal::ExtensionSet::Extension::string_value
std::string * string_value
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:563
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
google::protobuf.internal.decoder.SkipField
def SkipField
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/decoder.py:1036
google::protobuf.internal::DescriptorPoolExtensionFinder::pool_
const DescriptorPool * pool_
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:97
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
google::protobuf.internal::MessageSetFieldSkipper::~MessageSetFieldSkipper
~MessageSetFieldSkipper() override
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:65
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:561
google::protobuf::UnknownFieldSet
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:81
google::protobuf::io::CodedInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:180
google::protobuf.internal::ExtensionSet::Extension::SpaceUsedExcludingSelfLong
size_t SpaceUsedExcludingSelfLong() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:419
google::protobuf.internal::ExtensionSet::ParseFieldMaybeLazily
bool ParseFieldMaybeLazily(int wire_type, int field_number, io::CodedInputStream *input, ExtensionFinder *extension_finder, MessageSetFieldSkipper *field_skipper)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:480
google::protobuf.internal::ExtensionSet::GetMessage
const MessageLite & GetMessage(int number, const MessageLite &default_value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:572
arg
struct arg arg
GOOGLE_CHECK
#define GOOGLE_CHECK(EXPRESSION)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:153
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf.internal::UnknownFieldSetFieldSkipper::unknown_fields_
UnknownFieldSet * unknown_fields_
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:305
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf.internal::WireFormatLite::WireType
WireType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:101
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf.internal::DescriptorPoolExtensionFinder::DescriptorPoolExtensionFinder
DescriptorPoolExtensionFinder(const DescriptorPool *pool, MessageFactory *factory, const Descriptor *containing_type)
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:88
pool
InternalDescriptorPool * pool
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:807
google::protobuf::EnumValueDescriptor::full_name
const std::string & full_name() const
google::protobuf.internal::ExtensionSet::UnsafeArenaReleaseMessage
MessageLite * UnsafeArenaReleaseMessage(int number, const MessageLite &prototype)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:723
google::protobuf.internal::ExtensionSet::MaybeNewRepeatedExtension
Extension * MaybeNewRepeatedExtension(const FieldDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:244
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf.internal::ExtensionSet::FindExtensionInfoFromFieldNumber
bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number, ExtensionFinder *extension_finder, ExtensionInfo *extension, bool *was_packed_on_wire)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1162
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf.internal::ExtensionSet::AddMessage
MessageLite * AddMessage(int number, FieldType type, const MessageLite &prototype, desc)
google::protobuf.internal::ExtensionSet::Extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:551
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
google::protobuf::FieldDescriptor::TypeToCppType
static CppType TypeToCppType(Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2147
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
google::protobuf.internal::ExtensionSet::UnsafeArenaAddAllocatedMessage
void UnsafeArenaAddAllocatedMessage(const FieldDescriptor *descriptor, MessageLite *new_entry)
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:290
google::protobuf.internal::ExtensionSet::MessageSetByteSize
size_t MessageSetByteSize() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:2136
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf.internal::MessageSetFieldSkipper
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:61
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
google::protobuf::FieldDescriptor::CppType
CppType
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:553
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
Message
Definition: protobuf/php/ext/google/protobuf/message.c:53
google::protobuf.internal::ExtensionSet::ParseMessageSetItem
bool ParseMessageSetItem(io::CodedInputStream *input, ExtensionFinder *extension_finder, MessageSetFieldSkipper *field_skipper)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:511
google::protobuf.internal::ExtensionSet::ParseField
bool ParseField(uint32 tag, io::CodedInputStream *input, ExtensionFinder *extension_finder, FieldSkipper *field_skipper)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1184
google::protobuf.internal::cpp_type
FieldDescriptor::CppType cpp_type(FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:133
google::protobuf.internal::DescriptorPoolExtensionFinder::~DescriptorPoolExtensionFinder
~DescriptorPoolExtensionFinder() override
Definition: protobuf/src/google/protobuf/extension_set_heavy.cc:92
google::protobuf::FieldDescriptor::MAX_TYPE
@ MAX_TYPE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:546
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


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