protobuf/src/google/protobuf/message_lite.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 // Authors: wink@google.com (Wink Saville),
32 // kenton@google.com (Kenton Varda)
33 // Based on original Protocol Buffers design by
34 // Sanjay Ghemawat, Jeff Dean, and others.
35 
36 #include <google/protobuf/message_lite.h>
37 
38 #include <climits>
39 #include <cstdint>
40 #include <string>
41 
42 #include <google/protobuf/stubs/logging.h>
43 #include <google/protobuf/stubs/common.h>
44 #include <google/protobuf/stubs/stringprintf.h>
45 #include <google/protobuf/parse_context.h>
46 #include <google/protobuf/io/coded_stream.h>
47 #include <google/protobuf/io/zero_copy_stream.h>
48 #include <google/protobuf/io/zero_copy_stream_impl.h>
49 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
50 #include <google/protobuf/arena.h>
51 #include <google/protobuf/generated_message_table_driven.h>
52 #include <google/protobuf/generated_message_util.h>
53 #include <google/protobuf/repeated_field.h>
54 #include <google/protobuf/stubs/strutil.h>
55 #include <google/protobuf/stubs/stl_util.h>
56 #include <google/protobuf/stubs/mutex.h>
57 
58 #include <google/protobuf/port_def.inc>
59 
60 namespace google {
61 namespace protobuf {
62 
64  return "(cannot determine missing fields for lite message)";
65 }
66 
68  std::uintptr_t address = reinterpret_cast<std::uintptr_t>(this);
69  return StrCat("MessageLite at 0x", strings::Hex(address));
70 }
71 
72 namespace {
73 
74 // When serializing, we first compute the byte size, then serialize the message.
75 // If serialization produces a different number of bytes than expected, we
76 // call this function, which crashes. The problem could be due to a bug in the
77 // protobuf implementation but is more likely caused by concurrent modification
78 // of the message. This function attempts to distinguish between the two and
79 // provide a useful error message.
80 void ByteSizeConsistencyError(size_t byte_size_before_serialization,
81  size_t byte_size_after_serialization,
82  size_t bytes_produced_by_serialization,
83  const MessageLite& message) {
84  GOOGLE_CHECK_EQ(byte_size_before_serialization, byte_size_after_serialization)
85  << message.GetTypeName()
86  << " was modified concurrently during serialization.";
87  GOOGLE_CHECK_EQ(bytes_produced_by_serialization, byte_size_before_serialization)
88  << "Byte size calculation and serialization were inconsistent. This "
89  "may indicate a bug in protocol buffers or it may be caused by "
90  "concurrent modification of "
91  << message.GetTypeName() << ".";
92  GOOGLE_LOG(FATAL) << "This shouldn't be called if all the sizes are equal.";
93 }
94 
95 std::string InitializationErrorMessage(const char* action,
96  const MessageLite& message) {
97  // Note: We want to avoid depending on strutil in the lite library, otherwise
98  // we'd use:
99  //
100  // return strings::Substitute(
101  // "Can't $0 message of type \"$1\" because it is missing required "
102  // "fields: $2",
103  // action, message.GetTypeName(),
104  // message.InitializationErrorString());
105 
107  result += "Can't ";
108  result += action;
109  result += " message of type \"";
110  result += message.GetTypeName();
111  result += "\" because it is missing required fields: ";
112  result += message.InitializationErrorString();
113  return result;
114 }
115 
116 inline StringPiece as_string_view(const void* data, int size) {
117  return StringPiece(static_cast<const char*>(data), size);
118 }
119 
120 // Returns true of all required fields are present / have values.
121 inline bool CheckFieldPresence(const internal::ParseContext& ctx,
122  const MessageLite& msg,
123  MessageLite::ParseFlags parse_flags) {
124  (void)ctx; // Parameter is used by Google-internal code.
125  if (PROTOBUF_PREDICT_FALSE((parse_flags & MessageLite::kMergePartial) != 0)) {
126  return true;
127  }
128  return msg.IsInitializedWithErrors();
129 }
130 
131 } // namespace
132 
134  GOOGLE_LOG(ERROR) << InitializationErrorMessage("parse", *this);
135 }
136 
137 namespace internal {
138 
139 template <bool aliasing>
141  MessageLite::ParseFlags parse_flags) {
142  const char* ptr;
144  aliasing, &ptr, input);
145  ptr = msg->_InternalParse(ptr, &ctx);
146  // ctx has an explicit limit set (length of string_view).
147  if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtLimit())) {
148  return CheckFieldPresence(ctx, *msg, parse_flags);
149  }
150  return false;
151 }
152 
153 template <bool aliasing>
155  MessageLite::ParseFlags parse_flags) {
156  const char* ptr;
158  aliasing, &ptr, input);
159  ptr = msg->_InternalParse(ptr, &ctx);
160  // ctx has no explicit limit (hence we end on end of stream)
161  if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtEndOfStream())) {
162  return CheckFieldPresence(ctx, *msg, parse_flags);
163  }
164  return false;
165 }
166 
167 template <bool aliasing>
169  MessageLite::ParseFlags parse_flags) {
170  const char* ptr;
172  aliasing, &ptr, input.zcis, input.limit);
173  ptr = msg->_InternalParse(ptr, &ctx);
174  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
175  ctx.BackUp(ptr);
176  if (PROTOBUF_PREDICT_TRUE(ctx.EndedAtLimit())) {
177  return CheckFieldPresence(ctx, *msg, parse_flags);
178  }
179  return false;
180 }
181 
183  MessageLite::ParseFlags parse_flags);
185  MessageLite::ParseFlags parse_flags);
187  MessageLite* msg,
188  MessageLite::ParseFlags parse_flags);
190  MessageLite* msg,
191  MessageLite::ParseFlags parse_flags);
192 template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
193  MessageLite::ParseFlags parse_flags);
194 template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
195  MessageLite::ParseFlags parse_flags);
196 
197 } // namespace internal
198 
199 class ZeroCopyCodedInputStream : public io::ZeroCopyInputStream {
200  public:
202  bool Next(const void** data, int* size) final {
203  if (!cis_->GetDirectBufferPointer(data, size)) return false;
204  cis_->Skip(*size);
205  return true;
206  }
207  void BackUp(int count) final { cis_->Advance(-count); }
208  bool Skip(int count) final { return cis_->Skip(count); }
209  int64_t ByteCount() const final { return 0; }
210 
211  bool aliasing_enabled() { return cis_->aliasing_enabled_; }
212 
213  private:
214  io::CodedInputStream* cis_;
215 };
216 
218  MessageLite::ParseFlags parse_flags) {
220  const char* ptr;
221  internal::ParseContext ctx(input->RecursionBudget(), zcis.aliasing_enabled(),
222  &ptr, &zcis);
223  // MergePartialFromCodedStream allows terminating the wireformat by 0 or
224  // end-group tag. Leaving it up to the caller to verify correct ending by
225  // calling LastTagWas on input. We need to maintain this behavior.
226  ctx.TrackCorrectEnding();
227  ctx.data().pool = input->GetExtensionPool();
228  ctx.data().factory = input->GetExtensionFactory();
229  ptr = _InternalParse(ptr, &ctx);
230  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
231  ctx.BackUp(ptr);
232  if (!ctx.EndedAtEndOfStream()) {
233  GOOGLE_DCHECK(ctx.LastTag() != 1); // We can't end on a pushed limit.
234  if (ctx.IsExceedingLimit(ptr)) return false;
235  input->SetLastTag(ctx.LastTag());
236  } else {
237  input->SetConsumed();
238  }
239  return CheckFieldPresence(ctx, *this, parse_flags);
240 }
241 
244 }
245 
247  return MergeFromImpl(input, kMerge);
248 }
249 
251  Clear();
252  return MergeFromImpl(input, kParse);
253 }
254 
256  Clear();
258 }
259 
261  return ParseFrom<kParse>(input);
262 }
263 
266  return ParseFrom<kParsePartial>(input);
267 }
268 
269 bool MessageLite::ParseFromFileDescriptor(int file_descriptor) {
270  io::FileInputStream input(file_descriptor);
271  return ParseFromZeroCopyStream(&input) && input.GetErrno() == 0;
272 }
273 
274 bool MessageLite::ParsePartialFromFileDescriptor(int file_descriptor) {
275  io::FileInputStream input(file_descriptor);
276  return ParsePartialFromZeroCopyStream(&input) && input.GetErrno() == 0;
277 }
278 
279 bool MessageLite::ParseFromIstream(std::istream* input) {
280  io::IstreamInputStream zero_copy_input(input);
281  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
282 }
283 
284 bool MessageLite::ParsePartialFromIstream(std::istream* input) {
285  io::IstreamInputStream zero_copy_input(input);
286  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
287 }
288 
291  return ParseFrom<kMergePartial>(internal::BoundedZCIS{input, size});
292 }
293 
295  int size) {
296  return ParseFrom<kMerge>(internal::BoundedZCIS{input, size});
297 }
298 
300  int size) {
301  return ParseFrom<kParse>(internal::BoundedZCIS{input, size});
302 }
303 
306  return ParseFrom<kParsePartial>(internal::BoundedZCIS{input, size});
307 }
308 
310  return ParseFrom<kParse>(data);
311 }
312 
314  return ParseFrom<kParsePartial>(data);
315 }
316 
317 bool MessageLite::ParseFromArray(const void* data, int size) {
318  return ParseFrom<kParse>(as_string_view(data, size));
319 }
320 
321 bool MessageLite::ParsePartialFromArray(const void* data, int size) {
322  return ParseFrom<kParsePartial>(as_string_view(data, size));
323 }
324 
326  return ParseFrom<kMerge>(data);
327 }
328 
329 
330 // ===================================================================
331 
333  int size) {
334  constexpr bool debug = false;
335  if (debug) {
336  // Force serialization to a stream with a block size of 1, which forces
337  // all writes to the stream to cross buffers triggering all fallback paths
338  // in the unittests when serializing to string / array.
339  io::ArrayOutputStream stream(target, size, 1);
340  uint8_t* ptr;
341  io::EpsCopyOutputStream out(
343  &ptr);
344  ptr = msg._InternalSerialize(ptr, &out);
345  out.Trim(ptr);
346  GOOGLE_DCHECK(!out.HadError() && stream.ByteCount() == size);
347  return target + size;
348  } else {
349  io::EpsCopyOutputStream out(
350  target, size,
352  auto res = msg._InternalSerialize(target, &out);
353  GOOGLE_DCHECK(target + size == res);
354  return res;
355  }
356 }
357 
359  // We only optimize this when using optimize_for = SPEED. In other cases
360  // we just use the CodedOutputStream path.
361  return SerializeToArrayImpl(*this, target, GetCachedSize());
362 }
363 
365  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
367 }
368 
370  io::CodedOutputStream* output) const {
371  const size_t size = ByteSizeLong(); // Force size to be cached.
372  if (size > INT_MAX) {
374  << " exceeded maximum protobuf size of 2GB: " << size;
375  return false;
376  }
377 
378  int original_byte_count = output->ByteCount();
380  if (output->HadError()) {
381  return false;
382  }
383  int final_byte_count = output->ByteCount();
384 
385  if (final_byte_count - original_byte_count != static_cast<int64_t>(size)) {
386  ByteSizeConsistencyError(size, ByteSizeLong(),
387  final_byte_count - original_byte_count, *this);
388  }
389 
390  return true;
391 }
392 
395  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
397 }
398 
401  const size_t size = ByteSizeLong(); // Force size to be cached.
402  if (size > INT_MAX) {
404  << " exceeded maximum protobuf size of 2GB: " << size;
405  return false;
406  }
407 
408  uint8_t* target;
409  io::EpsCopyOutputStream stream(
411  &target);
413  stream.Trim(target);
414  if (stream.HadError()) return false;
415  return true;
416 }
417 
418 bool MessageLite::SerializeToFileDescriptor(int file_descriptor) const {
419  io::FileOutputStream output(file_descriptor);
420  return SerializeToZeroCopyStream(&output) && output.Flush();
421 }
422 
423 bool MessageLite::SerializePartialToFileDescriptor(int file_descriptor) const {
424  io::FileOutputStream output(file_descriptor);
425  return SerializePartialToZeroCopyStream(&output) && output.Flush();
426 }
427 
428 bool MessageLite::SerializeToOstream(std::ostream* output) const {
429  {
430  io::OstreamOutputStream zero_copy_output(output);
431  if (!SerializeToZeroCopyStream(&zero_copy_output)) return false;
432  }
433  return output->good();
434 }
435 
436 bool MessageLite::SerializePartialToOstream(std::ostream* output) const {
437  io::OstreamOutputStream zero_copy_output(output);
438  return SerializePartialToZeroCopyStream(&zero_copy_output);
439 }
440 
442  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
444 }
445 
447  size_t old_size = output->size();
448  size_t byte_size = ByteSizeLong();
449  if (byte_size > INT_MAX) {
451  << " exceeded maximum protobuf size of 2GB: " << byte_size;
452  return false;
453  }
454 
456  uint8_t* start =
457  reinterpret_cast<uint8_t*>(io::mutable_string_data(output) + old_size);
458  SerializeToArrayImpl(*this, start, byte_size);
459  return true;
460 }
461 
463  output->clear();
464  return AppendToString(output);
465 }
466 
468  output->clear();
470 }
471 
472 bool MessageLite::SerializeToArray(void* data, int size) const {
473  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
475 }
476 
477 bool MessageLite::SerializePartialToArray(void* data, int size) const {
478  const size_t byte_size = ByteSizeLong();
479  if (byte_size > INT_MAX) {
481  << " exceeded maximum protobuf size of 2GB: " << byte_size;
482  return false;
483  }
484  if (size < static_cast<int64_t>(byte_size)) return false;
485  uint8_t* start = reinterpret_cast<uint8_t*>(data);
486  SerializeToArrayImpl(*this, start, byte_size);
487  return true;
488 }
489 
491  // If the compiler implements the (Named) Return Value Optimization,
492  // the local variable 'output' will not actually reside on the stack
493  // of this function, but will be overlaid with the object that the
494  // caller supplied for the return value to be constructed in.
496  if (!AppendToString(&output)) output.clear();
497  return output;
498 }
499 
502  if (!AppendPartialToString(&output)) output.clear();
503  return output;
504 }
505 
506 
507 namespace internal {
508 
509 template <>
511  const MessageLite* prototype, Arena* arena) {
512  return prototype->New(arena);
513 }
514 template <>
516  MessageLite* to) {
517  to->CheckTypeAndMergeFrom(from);
518 }
519 template <>
521  std::string* to) {
522  *to = from;
523 }
524 
525 // Non-inline variants of std::string specializations for
526 // various InternalMetadata routines.
527 template <>
528 void InternalMetadata::DoClear<std::string>() {
529  mutable_unknown_fields<std::string>()->clear();
530 }
531 
532 template <>
533 void InternalMetadata::DoMergeFrom<std::string>(const std::string& other) {
534  mutable_unknown_fields<std::string>()->append(other);
535 }
536 
537 template <>
538 void InternalMetadata::DoSwap<std::string>(std::string* other) {
539  mutable_unknown_fields<std::string>()->swap(*other);
540 }
541 
542 } // namespace internal
543 
544 
545 // ===================================================================
546 // Shutdown support.
547 
548 namespace internal {
549 
550 struct ShutdownData {
552  std::reverse(functions.begin(), functions.end());
553  for (auto pair : functions) pair.first(pair.second);
554  }
555 
556  static ShutdownData* get() {
557  static auto* data = new ShutdownData;
558  return data;
559  }
560 
561  std::vector<std::pair<void (*)(const void*), const void*>> functions;
562  Mutex mutex;
563 };
564 
565 static void RunZeroArgFunc(const void* arg) {
566  void (*func)() = reinterpret_cast<void (*)()>(const_cast<void*>(arg));
567  func();
568 }
569 
570 void OnShutdown(void (*func)()) {
571  OnShutdownRun(RunZeroArgFunc, reinterpret_cast<void*>(func));
572 }
573 
574 void OnShutdownRun(void (*f)(const void*), const void* arg) {
575  auto shutdown_data = ShutdownData::get();
576  MutexLock lock(&shutdown_data->mutex);
577  shutdown_data->functions.push_back(std::make_pair(f, arg));
578 }
579 
580 } // namespace internal
581 
583  // This function should be called only once, but accepts multiple calls.
584  static bool is_shutdown = false;
585  if (!is_shutdown) {
587  is_shutdown = true;
588  }
589 }
590 
591 
592 } // namespace protobuf
593 } // namespace google
594 
595 #include <google/protobuf/port_undef.inc>
google::protobuf.internal::ShutdownData::~ShutdownData
~ShutdownData()
Definition: protobuf/src/google/protobuf/message_lite.cc:551
google::protobuf::MessageLite::ParseFlags
ParseFlags
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:449
google::protobuf.internal::ShutdownData::get
static ShutdownData * get()
Definition: protobuf/src/google/protobuf/message_lite.cc:556
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
google::protobuf::ZeroCopyCodedInputStream::ZeroCopyCodedInputStream
ZeroCopyCodedInputStream(io::CodedInputStream *cis)
Definition: protobuf/src/google/protobuf/message_lite.cc:201
google::protobuf.internal::RunZeroArgFunc
static void RunZeroArgFunc(const void *arg)
Definition: protobuf/src/google/protobuf/message_lite.cc:565
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
google::protobuf::MessageLite::GetTypeName
virtual std::string GetTypeName() const =0
get
absl::string_view get(const Cont &c)
Definition: abseil-cpp/absl/strings/str_replace_test.cc:185
MutexLock
#define MutexLock(x)
Definition: bloaty/third_party/re2/util/mutex.h:125
ctx
Definition: benchmark-async.c:30
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
google::protobuf::MessageLite::ParsePartialFromZeroCopyStream
bool ParsePartialFromZeroCopyStream(io::ZeroCopyInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:239
google::protobuf::MessageLite::MergePartialFromBoundedZeroCopyStream
bool MergePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:264
google::protobuf::MessageLite::GetCachedSize
virtual int GetCachedSize() const =0
grpc::protobuf::io::ZeroCopyInputStream
GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:101
mutex
static uv_mutex_t mutex
Definition: threadpool.c:34
google::protobuf::MessageLite::Clear
virtual void Clear()=0
google::protobuf::MessageLite::ParseFromFileDescriptor
bool ParseFromFileDescriptor(int file_descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:244
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf::MessageLite::ParseFromCodedStream
bool ParseFromCodedStream(io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:225
google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic
static bool IsDefaultSerializationDeterministic()
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1232
Arena
Definition: arena.c:39
google::protobuf::MessageLite::SerializeToArray
bool SerializeToArray(void *data, int size) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:447
GOOGLE_CHECK_EQ
#define GOOGLE_CHECK_EQ(A, B)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:156
google::protobuf::MessageLite::AppendPartialToString
bool AppendPartialToString(std::string *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:421
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::io::CodedInputStream::GetDefaultRecursionLimit
static int GetDefaultRecursionLimit()
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:414
google::protobuf::MessageLite::kParse
@ kParse
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:451
google::protobuf.internal::ParseContext
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:336
google::protobuf::MessageLite::ParsePartialFromCodedStream
bool ParsePartialFromCodedStream(io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:230
google::protobuf::MessageLite::SerializePartialToZeroCopyStream
bool SerializePartialToZeroCopyStream(io::ZeroCopyOutputStream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:374
google::protobuf::MessageLite::MergePartialFromCodedStream
bool MergePartialFromCodedStream(io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:197
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::MessageLite::ParsePartialFromIstream
bool ParsePartialFromIstream(std::istream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:259
google::protobuf.internal::MergeFromImpl< false >
template bool MergeFromImpl< false >(StringPiece input, MessageLite *msg, MessageLite::ParseFlags parse_flags)
ctx
static struct test_ctx ctx
Definition: test-ipc-send-recv.c:65
grpc::protobuf::io::ZeroCopyOutputStream
GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:100
google::protobuf::STLStringResizeUninitializedAmortized
void STLStringResizeUninitializedAmortized(std::string *s, size_t new_size)
Definition: protobuf/src/google/protobuf/stubs/stl_util.h:55
to
size_t to
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1385
google::protobuf::ZeroCopyCodedInputStream::ByteCount
int64_t ByteCount() const final
Definition: protobuf/src/google/protobuf/message_lite.cc:209
google::protobuf::MessageLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:184
google::protobuf::io::mutable_string_data
char * mutable_string_data(std::string *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h:384
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf::MessageLite::LogInitializationErrorMessage
void LogInitializationErrorMessage() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:121
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1482
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
google::protobuf::MessageLite::MergeFromBoundedZeroCopyStream
bool MergeFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:269
google::protobuf.internal::OnShutdown
void OnShutdown(void(*func)())
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/common.cc:344
make_dist_html.reverse
reverse
Definition: make_dist_html.py:119
google::protobuf::MessageLite::_InternalSerialize
virtual uint8_t * _InternalSerialize(uint8_t *ptr, io::EpsCopyOutputStream *stream) const =0
from
size_t from
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1384
google::protobuf::MessageLite::ParsePartialFromString
bool ParsePartialFromString(const std::string &data)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:288
google::protobuf::MessageLite::SerializeToZeroCopyStream
bool SerializeToZeroCopyStream(io::ZeroCopyOutputStream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:368
google::protobuf::MessageLite::SerializeWithCachedSizes
void SerializeWithCachedSizes(io::CodedOutputStream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:407
start
static uint64_t start
Definition: benchmark-pound.c:74
google::protobuf.internal::OnShutdownRun
void OnShutdownRun(void(*f)(const void *), const void *arg)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/common.cc:348
google::protobuf::ConstStringParam
const std::string & ConstStringParam
Definition: third_party/protobuf/src/google/protobuf/stubs/port.h:129
google::protobuf.internal::BoundedZCIS
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:503
google::protobuf::ZeroCopyCodedInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:179
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
google::protobuf::MessageLite::ParsePartialFromFileDescriptor
bool ParsePartialFromFileDescriptor(int file_descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:249
google::protobuf::MessageLite::ParseFromBoundedZeroCopyStream
bool ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:274
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
grpc::protobuf::MessageLite
GRPC_CUSTOM_MESSAGELITE MessageLite
Definition: include/grpcpp/impl/codegen/config_protobuf.h:79
google::protobuf::MessageLite::InitializationErrorString
virtual std::string InitializationErrorString() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:62
google::protobuf::StringPiece
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/stringpiece.h:180
google::protobuf::MessageLite::MergeFromCodedStream
bool MergeFromCodedStream(io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:221
google::protobuf::MessageLite::SerializePartialToFileDescriptor
bool SerializePartialToFileDescriptor(int file_descriptor) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:398
google::protobuf::MessageLite::_InternalParse
virtual const char * _InternalParse(const char *ptr, internal::ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:437
grpc::protobuf::io::CodedInputStream
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:102
google::protobuf::SerializeToArrayImpl
uint8 * SerializeToArrayImpl(const MessageLite &msg, uint8 *target, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:307
google::protobuf::MessageLite::SerializeToCodedStream
bool SerializeToCodedStream(io::CodedOutputStream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:339
google::protobuf::MessageLite::ParseFromZeroCopyStream
bool ParseFromZeroCopyStream(io::ZeroCopyInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:235
arg
Definition: cmdline.cc:40
google::protobuf::MessageLite::SerializeToString
bool SerializeToString(std::string *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:437
google::protobuf::MessageLite::ParseFromArray
bool ParseFromArray(const void *data, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:292
google::protobuf::MessageLite::AppendToString
bool AppendToString(std::string *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:416
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
grpc::protobuf::io::CodedOutputStream
GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream
Definition: src/compiler/config.h:55
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
google::protobuf::MessageLite::kMergePartial
@ kMergePartial
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:452
google::protobuf.text_format.Merge
def Merge(text, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
Definition: bloaty/third_party/protobuf/python/google/protobuf/text_format.py:659
google::protobuf::MessageLite::kParsePartial
@ kParsePartial
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:453
google::protobuf::MessageLite::SerializePartialToCodedStream
bool SerializePartialToCodedStream(io::CodedOutputStream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:344
google::protobuf::ERROR
static const LogLevel ERROR
Definition: bloaty/third_party/protobuf/src/google/protobuf/testing/googletest.h:70
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google::protobuf::MessageLite::SerializePartialToOstream
bool SerializePartialToOstream(std::ostream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:411
google::protobuf::MessageLite::SerializePartialToArray
bool SerializePartialToArray(void *data, int size) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:452
google::protobuf::io::ZeroCopyInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/zero_copy_stream.h:126
google::protobuf.internal::MergeFromImpl< true >
template bool MergeFromImpl< true >(StringPiece input, MessageLite *msg, MessageLite::ParseFlags parse_flags)
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf::MessageLite::SerializeToOstream
bool SerializeToOstream(std::ostream *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:403
func
const EVP_CIPHER *(* func)(void)
Definition: cipher_extra.c:73
google::protobuf::MessageLite::ParsePartialFromBoundedZeroCopyStream
bool ParsePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream *input, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:279
google::protobuf::MessageLite::ByteSizeLong
virtual size_t ByteSizeLong() const =0
client.action
action
Definition: examples/python/xds/client.py:49
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
google::protobuf::ZeroCopyCodedInputStream::BackUp
void BackUp(int count) final
Definition: protobuf/src/google/protobuf/message_lite.cc:207
google::protobuf::MessageLite::IsInitialized
virtual bool IsInitialized() const =0
google::protobuf::MessageLite::SerializeToFileDescriptor
bool SerializeToFileDescriptor(int file_descriptor) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:393
google::protobuf::MessageLite::SerializePartialToString
bool SerializePartialToString(std::string *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:442
google::protobuf::MessageLite::SerializeAsString
std::string SerializeAsString() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:465
google::protobuf::MessageLite::SerializePartialAsString
std::string SerializePartialAsString() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:475
google::protobuf.internal::Mutex
WrappedMutex Mutex
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/mutex.h:113
google::protobuf::MessageLite::MergeFromImpl
bool MergeFromImpl(io::CodedInputStream *input, ParseFlags parse_flags)
Definition: protobuf/src/google/protobuf/message_lite.cc:217
google::protobuf::io::CodedInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:180
google::protobuf::MessageLite::ParseFromString
bool ParseFromString(const std::string &data)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:284
google::protobuf::MessageLite::kMerge
@ kMerge
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:450
google::protobuf.internal::ShutdownData
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/common.cc:324
_gevent_test_main.debug
def debug(sig, frame)
Definition: _gevent_test_main.py:57
google::protobuf::ZeroCopyCodedInputStream::Skip
bool Skip(int count) final
Definition: protobuf/src/google/protobuf/message_lite.cc:208
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::MessageLite::ParseFromIstream
bool ParseFromIstream(std::istream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:254
google::protobuf::MessageLite::SerializeWithCachedSizesToArray
uint8 * SerializeWithCachedSizesToArray(uint8 *target) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:333
google::protobuf::MessageLite::MergeFromString
bool MergeFromString(const std::string &data)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:300
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf::ZeroCopyCodedInputStream::aliasing_enabled
bool aliasing_enabled()
Definition: protobuf/src/google/protobuf/message_lite.cc:211
google::protobuf.internal::GenericTypeHandler
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/arena.h:93
google::protobuf::MessageLite::DebugString
std::string DebugString() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:66
google::protobuf::ZeroCopyCodedInputStream::Next
bool Next(const void **data, int *size) final
Definition: protobuf/src/google/protobuf/message_lite.cc:202
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
google::protobuf.internal::MergeFromImpl
bool MergeFromImpl(StringPiece input, MessageLite *msg, MessageLite::ParseFlags parse_flags)
Definition: protobuf/src/google/protobuf/message_lite.cc:140
google::protobuf::ShutdownProtobufLibrary
void ShutdownProtobufLibrary()
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/common.cc:356
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
pair
std::pair< std::string, std::string > pair
Definition: abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc:78
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
binary_size.old_size
old_size
Definition: binary_size.py:125
google::protobuf::MessageLite::ParsePartialFromArray
bool ParsePartialFromArray(const void *data, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:296
google::protobuf::MessageLite::New
virtual MessageLite * New() const =0
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


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