msg.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2021, Google LLC
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of Google LLC nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #include "upb/msg.h"
29 
30 #include "upb/msg_internal.h"
31 #include "upb/port_def.inc"
32 #include "upb/table_internal.h"
33 
36 static const size_t overhead = sizeof(upb_Message_InternalData);
37 
39  const upb_Message* msg) {
40  ptrdiff_t size = sizeof(upb_Message_Internal);
41  return (upb_Message_Internal*)((char*)msg - size);
42 }
43 
45  return _upb_Message_New_inl(l, a);
46 }
47 
49  void* mem = UPB_PTR_AT(msg, -sizeof(upb_Message_Internal), char);
50  memset(mem, 0, upb_msg_sizeof(l));
51 }
52 
53 static bool realloc_internal(upb_Message* msg, size_t need, upb_Arena* arena) {
55  if (!in->internal) {
56  /* No internal data, allocate from scratch. */
57  size_t size = UPB_MAX(128, _upb_Log2CeilingSize(need + overhead));
59  if (!internal) return false;
60  internal->size = size;
61  internal->unknown_end = overhead;
62  internal->ext_begin = size;
63  in->internal = internal;
64  } else if (in->internal->ext_begin - in->internal->unknown_end < need) {
65  /* Internal data is too small, reallocate. */
66  size_t new_size = _upb_Log2CeilingSize(in->internal->size + need);
67  size_t ext_bytes = in->internal->size - in->internal->ext_begin;
68  size_t new_ext_begin = new_size - ext_bytes;
69  upb_Message_InternalData* internal =
70  upb_Arena_Realloc(arena, in->internal, in->internal->size, new_size);
71  if (!internal) return false;
72  if (ext_bytes) {
73  /* Need to move extension data to the end. */
74  char* ptr = (char*)internal;
75  memmove(ptr + new_ext_begin, ptr + internal->ext_begin, ext_bytes);
76  }
77  internal->ext_begin = new_ext_begin;
78  internal->size = new_size;
79  in->internal = internal;
80  }
81  UPB_ASSERT(in->internal->ext_begin - in->internal->unknown_end >= need);
82  return true;
83 }
84 
85 bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
86  upb_Arena* arena) {
87  if (!realloc_internal(msg, len, arena)) return false;
89  memcpy(UPB_PTR_AT(in->internal, in->internal->unknown_end, char), data, len);
90  in->internal->unknown_end += len;
91  return true;
92 }
93 
96  if (in->internal) {
97  in->internal->unknown_end = overhead;
98  }
99 }
100 
101 const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) {
103  if (in->internal) {
104  *len = in->internal->unknown_end - overhead;
105  return (char*)(in->internal + 1);
106  } else {
107  *len = 0;
108  return NULL;
109  }
110 }
111 
113  size_t* count) {
115  if (in->internal) {
116  *count = (in->internal->size - in->internal->ext_begin) /
117  sizeof(upb_Message_Extension);
118  return UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
119  } else {
120  *count = 0;
121  return NULL;
122  }
123 }
124 
126  const upb_Message* msg, const upb_MiniTable_Extension* e) {
127  size_t n;
129 
130  /* For now we use linear search exclusively to find extensions. If this
131  * becomes an issue due to messages with lots of extensions, we can introduce
132  * a table of some sort. */
133  for (size_t i = 0; i < n; i++) {
134  if (ext[i].ext == e) {
135  return &ext[i];
136  }
137  }
138 
139  return NULL;
140 }
141 
143  const upb_MiniTable_Extension* ext_l) {
145  if (!in->internal) return;
146  const upb_Message_Extension* base =
147  UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
150  if (ext) {
151  *ext = *base;
152  in->internal->ext_begin += sizeof(upb_Message_Extension);
153  }
154 }
155 
160  if (ext) return ext;
161  if (!realloc_internal(msg, sizeof(upb_Message_Extension), arena)) return NULL;
163  in->internal->ext_begin -= sizeof(upb_Message_Extension);
164  ext = UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
165  memset(ext, 0, sizeof(upb_Message_Extension));
166  ext->ext = e;
167  return ext;
168 }
169 
171  size_t count;
173  return count;
174 }
175 
178 bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena) {
179  size_t new_size = UPB_MAX(arr->size, 4);
180  int elem_size_lg2 = arr->data & 7;
181  size_t old_bytes = arr->size << elem_size_lg2;
182  size_t new_bytes;
183  void* ptr = _upb_array_ptr(arr);
184 
185  /* Log2 ceiling of size. */
186  while (new_size < min_size) new_size *= 2;
187 
188  new_bytes = new_size << elem_size_lg2;
189  ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes);
190 
191  if (!ptr) {
192  return false;
193  }
194 
195  arr->data = _upb_tag_arrptr(ptr, elem_size_lg2);
196  arr->size = new_size;
197  return true;
198 }
199 
200 static upb_Array* getorcreate_array(upb_Array** arr_ptr, int elem_size_lg2,
201  upb_Arena* arena) {
202  upb_Array* arr = *arr_ptr;
203  if (!arr) {
204  arr = _upb_Array_New(arena, 4, elem_size_lg2);
205  if (!arr) return NULL;
206  *arr_ptr = arr;
207  }
208  return arr;
209 }
210 
211 void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size,
212  int elem_size_lg2, upb_Arena* arena) {
213  upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
214  return arr && _upb_Array_Resize(arr, size, arena) ? _upb_array_ptr(arr)
215  : NULL;
216 }
217 
218 bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value,
219  int elem_size_lg2, upb_Arena* arena) {
220  upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
221  if (!arr) return false;
222 
223  size_t elems = arr->len;
224 
225  if (!_upb_Array_Resize(arr, elems + 1, arena)) {
226  return false;
227  }
228 
229  char* data = _upb_array_ptr(arr);
230  memcpy(data + (elems << elem_size_lg2), value, 1 << elem_size_lg2);
231  return true;
232 }
233 
236 upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size) {
237  upb_Map* map = upb_Arena_Malloc(a, sizeof(upb_Map));
238 
239  if (!map) {
240  return NULL;
241  }
242 
243  upb_strtable_init(&map->table, 4, a);
244  map->key_size = key_size;
245  map->val_size = value_size;
246 
247  return map;
248 }
249 
250 static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key,
251  void* b_key, size_t size) {
252  const upb_tabent* const* a = _a;
253  const upb_tabent* const* b = _b;
254  upb_StringView a_tabkey = upb_tabstrview((*a)->key);
255  upb_StringView b_tabkey = upb_tabstrview((*b)->key);
256  _upb_map_fromkey(a_tabkey, a_key, size);
257  _upb_map_fromkey(b_tabkey, b_key, size);
258 }
259 
260 #define UPB_COMPARE_INTEGERS(a, b) ((a) < (b) ? -1 : ((a) == (b) ? 0 : 1))
261 
262 static int _upb_mapsorter_cmpi64(const void* _a, const void* _b) {
263  int64_t a, b;
264  _upb_mapsorter_getkeys(_a, _b, &a, &b, 8);
265  return UPB_COMPARE_INTEGERS(a, b);
266 }
267 
268 static int _upb_mapsorter_cmpu64(const void* _a, const void* _b) {
269  uint64_t a, b;
270  _upb_mapsorter_getkeys(_a, _b, &a, &b, 8);
271  return UPB_COMPARE_INTEGERS(a, b);
272 }
273 
274 static int _upb_mapsorter_cmpi32(const void* _a, const void* _b) {
275  int32_t a, b;
276  _upb_mapsorter_getkeys(_a, _b, &a, &b, 4);
277  return UPB_COMPARE_INTEGERS(a, b);
278 }
279 
280 static int _upb_mapsorter_cmpu32(const void* _a, const void* _b) {
281  uint32_t a, b;
282  _upb_mapsorter_getkeys(_a, _b, &a, &b, 4);
283  return UPB_COMPARE_INTEGERS(a, b);
284 }
285 
286 static int _upb_mapsorter_cmpbool(const void* _a, const void* _b) {
287  bool a, b;
288  _upb_mapsorter_getkeys(_a, _b, &a, &b, 1);
289  return UPB_COMPARE_INTEGERS(a, b);
290 }
291 
292 static int _upb_mapsorter_cmpstr(const void* _a, const void* _b) {
293  upb_StringView a, b;
295  size_t common_size = UPB_MIN(a.size, b.size);
296  int cmp = memcmp(a.data, b.data, common_size);
297  if (cmp) return -cmp;
298  return UPB_COMPARE_INTEGERS(a.size, b.size);
299 }
300 
301 #undef UPB_COMPARE_INTEGERS
302 
304  const upb_Map* map, _upb_sortedmap* sorted) {
305  int map_size = _upb_Map_Size(map);
306  sorted->start = s->size;
307  sorted->pos = sorted->start;
308  sorted->end = sorted->start + map_size;
309 
310  /* Grow s->entries if necessary. */
311  if (sorted->end > s->cap) {
312  s->cap = _upb_Log2CeilingSize(sorted->end);
313  s->entries = realloc(s->entries, s->cap * sizeof(*s->entries));
314  if (!s->entries) return false;
315  }
316 
317  s->size = sorted->end;
318 
319  /* Copy non-empty entries from the table to s->entries. */
320  upb_tabent const** dst = &s->entries[sorted->start];
321  const upb_tabent* src = map->table.t.entries;
322  const upb_tabent* end = src + upb_table_size(&map->table.t);
323  for (; src < end; src++) {
324  if (!upb_tabent_isempty(src)) {
325  *dst = src;
326  dst++;
327  }
328  }
329  UPB_ASSERT(dst == &s->entries[sorted->end]);
330 
331  /* Sort entries according to the key type. */
332 
333  int (*compar)(const void*, const void*);
334 
335  switch (key_type) {
339  compar = _upb_mapsorter_cmpi64;
340  break;
343  compar = _upb_mapsorter_cmpu64;
344  break;
348  case kUpb_FieldType_Enum:
349  compar = _upb_mapsorter_cmpi32;
350  break;
353  compar = _upb_mapsorter_cmpu32;
354  break;
355  case kUpb_FieldType_Bool:
356  compar = _upb_mapsorter_cmpbool;
357  break;
360  compar = _upb_mapsorter_cmpstr;
361  break;
362  default:
363  UPB_UNREACHABLE();
364  }
365 
366  qsort(&s->entries[sorted->start], map_size, sizeof(*s->entries), compar);
367  return true;
368 }
369 
374  upb_strtable exts; /* Key is upb_MiniTable* concatenated with fieldnum. */
375 };
376 
377 #define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
378 
379 static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
380  memcpy(buf, &l, sizeof(l));
381  memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
382 }
383 
386  if (!r) return NULL;
387  r->arena = arena;
388  if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
389  return r;
390 }
391 
393  const upb_MiniTable_Extension** e, size_t count) {
394  char buf[EXTREG_KEY_SIZE];
395  const upb_MiniTable_Extension** start = e;
397  for (; e < end; e++) {
398  const upb_MiniTable_Extension* ext = *e;
399  extreg_key(buf, ext->extendee, ext->field.number);
401  upb_value_constptr(ext), r->arena)) {
402  goto failure;
403  }
404  }
405  return true;
406 
407 failure:
408  /* Back out the entries previously added. */
409  for (end = e, e = start; e < end; e++) {
410  const upb_MiniTable_Extension* ext = *e;
411  extreg_key(buf, ext->extendee, ext->field.number);
412  upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
413  }
414  return false;
415 }
416 
418  const upb_MiniTable* l,
419  uint32_t num) {
420  char buf[EXTREG_KEY_SIZE];
421  upb_value v;
422  extreg_key(buf, l, num);
423  if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
424  return upb_value_getconstptr(v);
425  } else {
426  return NULL;
427  }
428 }
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
upb_Array::size
size_t size
Definition: msg_internal.h:427
upb_Message_ExtensionCount
size_t upb_Message_ExtensionCount(const upb_Message *msg)
Definition: msg.c:170
kUpb_FieldType_SInt64
@ kUpb_FieldType_SInt64
Definition: upb/upb/upb.h:326
upb_FieldType
upb_FieldType
Definition: upb/upb/upb.h:308
kUpb_FieldType_SFixed64
@ kUpb_FieldType_SFixed64
Definition: upb/upb/upb.h:324
dst
static const char dst[]
Definition: test-fs-copyfile.c:37
_upb_Message_Getext
const upb_Message_Extension * _upb_Message_Getext(const upb_Message *msg, const upb_MiniTable_Extension *e)
Definition: msg.c:125
kUpb_FieldType_SInt32
@ kUpb_FieldType_SInt32
Definition: upb/upb/upb.h:325
upb_Arena_Realloc
UPB_INLINE void * upb_Arena_Realloc(upb_Arena *a, void *ptr, size_t oldsize, size_t size)
Definition: upb/upb/upb.h:246
getorcreate_array
static upb_Array * getorcreate_array(upb_Array **arr_ptr, int elem_size_lg2, upb_Arena *arena)
Definition: msg.c:200
memset
return memset(p, 0, total)
upb_tabent_isempty
UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:871
upb_strtable_init
UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:905
_upb_sortedmap::end
int end
Definition: php-upb.h:1697
_upb_sortedmap::start
int start
Definition: php-upb.h:1695
kUpb_FieldType_UInt64
@ kUpb_FieldType_UInt64
Definition: upb/upb/upb.h:312
_upb_Map_Size
UPB_INLINE size_t _upb_Map_Size(const upb_Map *map)
Definition: msg_internal.h:657
upb_Message_InternalData
Definition: msg_internal.h:251
upb_value
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:681
ext
void * ext
Definition: x509v3.h:87
_upb_mapsorter
Definition: php-upb.h:1688
_upb_Array_Append_fallback
bool _upb_Array_Append_fallback(upb_Array **arr_ptr, const void *value, int elem_size_lg2, upb_Arena *arena)
Definition: msg.c:218
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
upb_MiniTable_Extension
Definition: msg_internal.h:202
_upb_Message_New_inl
UPB_INLINE upb_Message * _upb_Message_New_inl(const upb_MiniTable *l, upb_Arena *a)
Definition: msg_internal.h:287
realloc_internal
static bool realloc_internal(upb_Message *msg, size_t need, upb_Arena *arena)
Definition: msg.c:53
UPB_UNREACHABLE
#define UPB_UNREACHABLE()
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:145
upb_Message_GetUnknown
const char * upb_Message_GetUnknown(const upb_Message *msg, size_t *len)
Definition: msg.c:101
binary_size.new_size
def new_size
Definition: binary_size.py:124
EXTREG_KEY_SIZE
#define EXTREG_KEY_SIZE
Definition: msg.c:377
_upb_Message_Getorcreateext
upb_Message_Extension * _upb_Message_Getorcreateext(upb_Message *msg, const upb_MiniTable_Extension *e, upb_Arena *arena)
Definition: msg.c:156
_upb_mapsorter_cmpi64
static int _upb_mapsorter_cmpi64(const void *_a, const void *_b)
Definition: msg.c:262
upb_Message_Getinternal
UPB_INLINE upb_Message_Internal * upb_Message_Getinternal(upb_Message *msg)
Definition: msg_internal.h:301
kUpb_FieldType_SFixed32
@ kUpb_FieldType_SFixed32
Definition: upb/upb/upb.h:323
upb_MiniTable
Definition: msg_internal.h:185
_upb_extreg_add
bool _upb_extreg_add(upb_ExtensionRegistry *r, const upb_MiniTable_Extension **e, size_t count)
Definition: msg.c:392
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
_upb_tag_arrptr
UPB_INLINE uintptr_t _upb_tag_arrptr(void *ptr, int elem_size_lg2)
Definition: php-upb.h:1354
_upb_Log2CeilingSize
UPB_INLINE int _upb_Log2CeilingSize(int x)
Definition: upb/upb/upb.h:365
upb_strtable_lookup2
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1612
UPB_PTR_AT
#define UPB_PTR_AT(msg, ofs, type)
Definition: php-upb.c:71
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
_upb_mapsorter_pushmap
bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_FieldType key_type, const upb_Map *map, _upb_sortedmap *sorted)
Definition: msg.c:303
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
msg.h
kUpb_FieldType_Bool
@ kUpb_FieldType_Bool
Definition: upb/upb/upb.h:316
UPB_MIN
#define UPB_MIN(x, y)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:126
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
upb_Message_Getinternal_const
static const upb_Message_Internal * upb_Message_Getinternal_const(const upb_Message *msg)
Definition: msg.c:38
upb_Message_Internal
Definition: msg_internal.h:275
_upb_array_ptr
UPB_INLINE void * _upb_array_ptr(upb_array *arr)
Definition: php-upb.h:1350
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
UPB_PTRADD
#define UPB_PTRADD(ptr, ofs)
Definition: php-upb.c:168
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
start
static uint64_t start
Definition: benchmark-pound.c:74
kUpb_FieldType_UInt32
@ kUpb_FieldType_UInt32
Definition: upb/upb/upb.h:321
_upb_Message_Getexts
const upb_Message_Extension * _upb_Message_Getexts(const upb_Message *msg, size_t *count)
Definition: msg.c:112
_upb_Message_New
upb_Message * _upb_Message_New(const upb_MiniTable *l, upb_Arena *a)
Definition: msg.c:44
UPB_COMPARE_INTEGERS
#define UPB_COMPARE_INTEGERS(a, b)
Definition: msg.c:260
xds_interop_client.int
int
Definition: xds_interop_client.py:113
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
kUpb_FieldType_String
@ kUpb_FieldType_String
Definition: upb/upb/upb.h:317
upb_msg_sizeof
static size_t upb_msg_sizeof(const upb_msglayout *l)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1157
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
_upb_sortedmap::pos
int pos
Definition: php-upb.h:1696
_upb_Message_DiscardUnknown_shallow
void _upb_Message_DiscardUnknown_shallow(upb_Message *msg)
Definition: msg.c:94
_upb_mapsorter_getkeys
static void _upb_mapsorter_getkeys(const void *_a, const void *_b, void *a_key, void *b_key, size_t size)
Definition: msg.c:250
upb_Message_Extension
Definition: msg_internal.h:327
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
kUpb_FieldType_Enum
@ kUpb_FieldType_Enum
Definition: upb/upb/upb.h:322
upb_Array
Definition: msg_internal.h:424
upb_Arena_Malloc
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
Definition: upb/upb/upb.h:222
kUpb_FieldType_Fixed32
@ kUpb_FieldType_Fixed32
Definition: upb/upb/upb.h:315
table_internal.h
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
upb_ExtensionRegistry::exts
upb_strtable exts
Definition: msg.c:374
upb_ExtensionRegistry::arena
upb_Arena * arena
Definition: msg.c:373
_upb_Message_AddUnknown
bool _upb_Message_AddUnknown(upb_Message *msg, const char *data, size_t len, upb_Arena *arena)
Definition: msg.c:85
_upb_Map_New
upb_Map * _upb_Map_New(upb_Arena *a, size_t key_size, size_t value_size)
Definition: msg.c:236
_upb_mapsorter_cmpu64
static int _upb_mapsorter_cmpu64(const void *_a, const void *_b)
Definition: msg.c:268
UPB_ASSERT
#define UPB_ASSERT(expr)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:135
gen_synthetic_protos.base
base
Definition: gen_synthetic_protos.py:31
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
tests.google.protobuf.internal.message_test.cmp
cmp
Definition: bloaty/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py:61
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
qsort
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))
Definition: qsort.h:130
upb_Message
void upb_Message
Definition: msg.h:49
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
_upb_mapsorter_cmpstr
static int _upb_mapsorter_cmpstr(const void *_a, const void *_b)
Definition: msg.c:292
_upb_mapsorter_cmpbool
static int _upb_mapsorter_cmpbool(const void *_a, const void *_b)
Definition: msg.c:286
mem
void * mem
Definition: libc.cpp:91
upb_Array::data
uintptr_t data
Definition: msg_internal.h:425
value
const char * value
Definition: hpack_parser_table.cc:165
kUpb_FieldType_Fixed64
@ kUpb_FieldType_Fixed64
Definition: upb/upb/upb.h:314
UPB_MAX
#define UPB_MAX(x, y)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:125
_upb_mapsorter_cmpi32
static int _upb_mapsorter_cmpi32(const void *_a, const void *_b)
Definition: msg.c:274
_upb_Array_Resize_fallback
void * _upb_Array_Resize_fallback(upb_Array **arr_ptr, size_t size, int elem_size_lg2, upb_Arena *arena)
Definition: msg.c:211
UPB_MAPTYPE_STRING
#define UPB_MAPTYPE_STRING
Definition: php-upb.c:82
upb_strtable_remove2
UPB_INLINE bool upb_strtable_remove2(upb_strtable *t, const char *key, size_t len, upb_value *val)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:976
upb_StringView
Definition: upb/upb/upb.h:72
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
_upb_extreg_get
const upb_MiniTable_Extension * _upb_extreg_get(const upb_ExtensionRegistry *r, const upb_MiniTable *l, uint32_t num)
Definition: msg.c:417
_upb_tabent
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:807
upb_Array::len
size_t len
Definition: msg_internal.h:426
fix_build_deps.r
r
Definition: fix_build_deps.py:491
_upb_Message_Clearext
void _upb_Message_Clearext(upb_Message *msg, const upb_MiniTable_Extension *ext_l)
Definition: msg.c:142
_upb_Array_Resize
UPB_INLINE bool _upb_Array_Resize(upb_Array *arr, size_t size, upb_Arena *arena)
Definition: msg_internal.h:478
upb_tabstrview
UPB_INLINE upb_strview upb_tabstrview(upb_tabkey key)
Definition: php-upb.h:864
xds_manager.num
num
Definition: xds_manager.py:56
_upb_Array_New
UPB_INLINE upb_Array * _upb_Array_New(upb_Arena *a, size_t init_size, int elem_size_lg2)
Definition: msg_internal.h:451
upb_strtable
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:844
upb_ExtensionRegistry_New
upb_ExtensionRegistry * upb_ExtensionRegistry_New(upb_Arena *arena)
Definition: msg.c:384
upb_Map
Definition: msg_internal.h:581
internal
Definition: benchmark/test/output_test_helper.cc:20
_upb_Message_Clear
void _upb_Message_Clear(upb_Message *msg, const upb_MiniTable *l)
Definition: msg.c:48
_upb_array_realloc
bool _upb_array_realloc(upb_Array *arr, size_t min_size, upb_Arena *arena)
Definition: msg.c:178
_upb_sortedmap
Definition: php-upb.h:1694
extreg_key
static void extreg_key(char *buf, const upb_MiniTable *l, uint32_t fieldnum)
Definition: msg.c:379
overhead
static const size_t overhead
Definition: msg.c:36
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
_upb_mapsorter_cmpu32
static int _upb_mapsorter_cmpu32(const void *_a, const void *_b)
Definition: msg.c:280
run_grpclb_interop_tests.l
dictionary l
Definition: run_grpclb_interop_tests.py:410
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
kUpb_FieldType_Int32
@ kUpb_FieldType_Int32
Definition: upb/upb/upb.h:313
key_type
upb_fieldtype_t key_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1071
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
_upb_map_fromkey
UPB_INLINE void _upb_map_fromkey(upb_strview key, void *out, size_t size)
Definition: php-upb.h:1531
kUpb_FieldType_Int64
@ kUpb_FieldType_Int64
Definition: upb/upb/upb.h:311
demo_pb2._b
int _b
Definition: demo_pb2.py:6
upb_strtable_insert
UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key, upb_value val)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:953
msg_internal.h
upb_Arena
Definition: upb_internal.h:36
upb_table_size
UPB_INLINE size_t upb_table_size(const upb_table *t)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:863
upb_ExtensionRegistry
Definition: msg.c:372
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
kUpb_FieldType_Bytes
@ kUpb_FieldType_Bytes
Definition: upb/upb/upb.h:320


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:41