msg_internal.h
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 /*
29 ** Our memory representation for parsing tables and messages themselves.
30 ** Functions in this file are used by generated code and possibly reflection.
31 **
32 ** The definitions in this file are internal to upb.
33 **/
34 
35 #ifndef UPB_MSG_INT_H_
36 #define UPB_MSG_INT_H_
37 
38 #include <stdint.h>
39 #include <stdlib.h>
40 #include <string.h>
41 
42 #include "upb/msg.h"
43 #include "upb/table_internal.h"
44 #include "upb/upb.h"
45 
46 /* Must be last. */
47 #include "upb/port_def.inc"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 
57 UPB_INLINE int64_t _upb_Int64_FromLL(long long v) { return (int64_t)v; }
58 
60 
62  return (uint64_t)v;
63 }
64 
67 /* upb_MiniTable represents the memory layout of a given upb_MessageDef. The
68  * members are public so generated code can initialize them, but users MUST NOT
69  * read or write any of its members. */
70 
71 typedef struct {
74  int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index
75  uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM
77  uint8_t mode; /* upb_FieldMode | upb_LabelFlags |
78  (upb_FieldRep << kUpb_FieldRep_Shift) */
80 
81 #define kUpb_NoSub ((uint16_t)-1)
82 
83 typedef enum {
88 
89 // Mask to isolate the upb_FieldMode from field.mode.
90 #define kUpb_FieldMode_Mask 3
91 
92 /* Extra flags on the mode field. */
93 typedef enum {
97 
98 // Note: we sort by this number when calculating layout order.
99 typedef enum {
105 
106  kUpb_FieldRep_Shift = 5, // Bit offset of the rep in upb_MiniTable_Field.mode
108 } upb_FieldRep;
109 
111  return (upb_FieldMode)(field->mode & 3);
112 }
113 
115  /* This works because upb_FieldMode has no value 3. */
116  return !(field->mode & kUpb_FieldMode_Scalar);
117 }
118 
120  return field->descriptortype == kUpb_FieldType_Message ||
121  field->descriptortype == kUpb_FieldType_Group;
122 }
123 
124 struct upb_Decoder;
125 struct upb_MiniTable;
126 
127 typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
129  uint64_t hasbits, uint64_t data);
130 
131 typedef struct {
135 
136 typedef struct {
137  const int32_t* values; // List of values <0 or >63
138  uint64_t mask; // Bits are set for acceptable value 0 <= x < 64
141 
143  int32_t val) {
144  uint32_t uval = (uint32_t)val;
145  if (uval < 64) return e->mask & (1 << uval);
146  // OPT: binary search long lists?
147  int n = e->value_count;
148  for (int i = 0; i < n; i++) {
149  if (e->values[i] == val) return true;
150  }
151  return false;
152 }
153 
154 typedef union {
155  const struct upb_MiniTable* submsg;
158 
159 typedef enum {
160  kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
161  kUpb_ExtMode_Extendable = 1, // Normal extendable message.
162  kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
164  3, // MessageSet item (temporary only, see decode.c)
165 
166  // During table building we steal a bit to indicate that the message is a map
167  // entry. *Only* used during table building!
169 } upb_ExtMode;
170 
171 /* MessageSet wire format is:
172  * message MessageSet {
173  * repeated group Item = 1 {
174  * required int32 type_id = 2;
175  * required string message = 3;
176  * }
177  * }
178  */
179 typedef enum {
184 
188  /* Must be aligned to sizeof(void*). Doesn't include internal members like
189  * unknown fields, extension dict, pointer to msglayout, etc. */
192  uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
195  uint8_t required_count; // Required fields have the lowest hasbits.
196  /* To statically initialize the tables of variable length, we need a flexible
197  * array member, and we need to compile in gnu99 mode (constant initialization
198  * of flexible array members is a GNU extension, not in C99 unfortunately. */
200 };
201 
202 typedef struct {
205  upb_MiniTable_Sub sub; /* NULL unless submessage or proto2 enum */
207 
208 typedef struct {
216 
217 // Computes a bitmask in which the |l->required_count| lowest bits are set,
218 // except that we skip the lowest bit (because upb never uses hasbit 0).
219 //
220 // Sample output:
221 // requiredmask(1) => 0b10 (0x2)
222 // requiredmask(5) => 0b111110 (0x3e)
224  int n = l->required_count;
225  assert(0 < n && n <= 63);
226  return ((1ULL << n) - 1) << 1;
227 }
228 
231 /* Adds the given extension info for message type |l| and field number |num|
232  * into the registry. Returns false if this message type and field number were
233  * already in the map, or if memory allocation fails. */
235  const upb_MiniTable_Extension** e, size_t count);
236 
237 /* Looks up the extension (if any) defined for message type |l| and field
238  * number |num|. If an extension was found, copies the field info into |*ext|
239  * and returns true. Otherwise returns false. */
241  const upb_MiniTable* l,
242  uint32_t num);
243 
246 /* Internal members of a upb_Message that track unknown fields and/or
247  * extensions. We can change this without breaking binary compatibility. We put
248  * these before the user's data. The user's upb_Message* points after the
249  * upb_Message_Internal. */
250 
251 typedef struct {
252  /* Total size of this structure, including the data that follows.
253  * Must be aligned to 8, which is alignof(upb_Message_Extension) */
255 
256  /* Offsets relative to the beginning of this structure.
257  *
258  * Unknown data grows forward from the beginning to unknown_end.
259  * Extension data grows backward from size to ext_begin.
260  * When the two meet, we're out of data and have to realloc.
261  *
262  * If we imagine that the final member of this struct is:
263  * char data[size - overhead]; // overhead =
264  * sizeof(upb_Message_InternalData)
265  *
266  * Then we have:
267  * unknown data: data[0 .. (unknown_end - overhead)]
268  * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
271  /* Data follows, as if there were an array:
272  * char data[size - sizeof(upb_Message_InternalData)]; */
274 
275 typedef struct {
277  /* Message data follows. */
279 
280 /* Maps upb_CType -> memory size. */
281 extern char _upb_CTypeo_size[12];
282 
284  return l->size + sizeof(upb_Message_Internal);
285 }
286 
288  upb_Arena* a) {
289  size_t size = upb_msg_sizeof(l);
290  void* mem = upb_Arena_Malloc(a, size);
291  upb_Message* msg;
292  if (UPB_UNLIKELY(!mem)) return NULL;
294  memset(mem, 0, size);
295  return msg;
296 }
297 
298 /* Creates a new messages with the given layout on the given arena. */
300 
302  ptrdiff_t size = sizeof(upb_Message_Internal);
303  return (upb_Message_Internal*)((char*)msg - size);
304 }
305 
306 /* Clears the given message. */
308 
309 /* Discards the unknown fields for this message only. */
311 
312 /* Adds unknown data (serialized protobuf data) to the given message. The data
313  * is copied into the message instance. */
314 bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
315  upb_Arena* arena);
316 
319 /* The internal representation of an extension is self-describing: it contains
320  * enough information that we can serialize it to binary format without needing
321  * to look it up in a upb_ExtensionRegistry.
322  *
323  * This representation allocates 16 bytes to data on 64-bit platforms. This is
324  * rather wasteful for scalars (in the extreme case of bool, it wastes 15
325  * bytes). We accept this because we expect messages to be the most common
326  * extension type. */
327 typedef struct {
329  union {
331  void* ptr;
332  char scalar_data[8];
333  } data;
335 
336 /* Adds the given extension data to the given message. |ext| is copied into the
337  * message instance. This logically replaces any previously-added extension with
338  * this number */
341 
342 /* Returns an array of extensions for this message. Note: the array is
343  * ordered in reverse relative to the order of creation. */
345  size_t* count);
346 
347 /* Returns an extension for the given field number, or NULL if no extension
348  * exists for this field number. */
350  const upb_Message* msg, const upb_MiniTable_Extension* ext);
351 
354 
357 
360 UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) {
361  return (*UPB_PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
362 }
363 
364 UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) {
365  (*UPB_PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
366 }
367 
369  (*UPB_PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
370 }
371 
373  UPB_ASSERT(f->presence > 0);
374  return f->presence;
375 }
376 
378  const upb_MiniTable_Field* f) {
380 }
381 
383  const upb_MiniTable_Field* f) {
385 }
386 
388  const upb_MiniTable_Field* f) {
390 }
391 
395  return UPB_PTR_AT(msg, case_ofs, uint32_t);
396 }
397 
398 UPB_INLINE uint32_t _upb_getoneofcase(const void* msg, size_t case_ofs) {
399  return *UPB_PTR_AT(msg, case_ofs, uint32_t);
400 }
401 
403  UPB_ASSERT(f->presence < 0);
404  return ~(ptrdiff_t)f->presence;
405 }
406 
408  const upb_MiniTable_Field* f) {
410 }
411 
413  const upb_MiniTable_Field* f) {
415 }
416 
418  return *UPB_PTR_AT(msg, ofs, const upb_Message*) != NULL;
419 }
420 
423 /* Our internal representation for repeated fields. */
424 typedef struct {
425  uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
426  size_t len; /* Measured in elements. */
427  size_t size; /* Measured in elements. */
429 } upb_Array;
430 
431 UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) {
432  UPB_ASSERT((arr->data & 7) <= 4);
433  return (void*)(arr->data & ~(uintptr_t)7);
434 }
435 
436 UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
437  UPB_ASSERT(elem_size_lg2 <= 4);
438  return (uintptr_t)ptr | elem_size_lg2;
439 }
440 
442  return (void*)_upb_array_constptr(arr);
443 }
444 
445 UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
446  UPB_ASSERT(elem_size_lg2 <= 4);
447  UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
448  return (uintptr_t)ptr | (unsigned)elem_size_lg2;
449 }
450 
452  int elem_size_lg2) {
453  const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), 8);
454  const size_t bytes = sizeof(upb_Array) + (init_size << elem_size_lg2);
456  if (!arr) return NULL;
457  arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
458  arr->len = 0;
459  arr->size = init_size;
460  return arr;
461 }
462 
463 /* Resizes the capacity of the array to be at least min_size. */
464 bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena);
465 
466 /* Fallback functions for when the accessors require a resize. */
467 void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size,
468  int elem_size_lg2, upb_Arena* arena);
469 bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value,
470  int elem_size_lg2, upb_Arena* arena);
471 
473  upb_Arena* arena) {
474  if (arr->size < size) return _upb_array_realloc(arr, size, arena);
475  return true;
476 }
477 
479  upb_Arena* arena) {
480  if (!_upb_array_reserve(arr, size, arena)) return false;
481  arr->len = size;
482  return true;
483 }
484 
485 UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
486  *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
487 }
488 
489 UPB_INLINE const void* _upb_array_accessor(const void* msg, size_t ofs,
490  size_t* size) {
491  const upb_Array* arr = *UPB_PTR_AT(msg, ofs, const upb_Array*);
492  if (arr) {
493  if (size) *size = arr->len;
494  return _upb_array_constptr(arr);
495  } else {
496  if (size) *size = 0;
497  return NULL;
498  }
499 }
500 
502  size_t* size) {
503  upb_Array* arr = *UPB_PTR_AT(msg, ofs, upb_Array*);
504  if (arr) {
505  if (size) *size = arr->len;
506  return _upb_array_ptr(arr);
507  } else {
508  if (size) *size = 0;
509  return NULL;
510  }
511 }
512 
513 UPB_INLINE void* _upb_Array_Resize_accessor2(void* msg, size_t ofs, size_t size,
514  int elem_size_lg2,
515  upb_Arena* arena) {
516  upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
517  upb_Array* arr = *arr_ptr;
518  if (!arr || arr->size < size) {
519  return _upb_Array_Resize_fallback(arr_ptr, size, elem_size_lg2, arena);
520  }
521  arr->len = size;
522  return _upb_array_ptr(arr);
523 }
524 
526  int elem_size_lg2,
527  const void* value,
528  upb_Arena* arena) {
529  upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
530  size_t elem_size = 1 << elem_size_lg2;
531  upb_Array* arr = *arr_ptr;
532  void* ptr;
533  if (!arr || arr->len == arr->size) {
534  return _upb_Array_Append_fallback(arr_ptr, value, elem_size_lg2, arena);
535  }
536  ptr = _upb_array_ptr(arr);
537  memcpy(UPB_PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
538  arr->len++;
539  return true;
540 }
541 
542 /* Used by old generated code, remove once all code has been regenerated. */
544  switch (type) {
545  case kUpb_CType_Bool:
546  return 0;
547  case kUpb_CType_Float:
548  case kUpb_CType_Int32:
549  case kUpb_CType_UInt32:
550  case kUpb_CType_Enum:
551  return 2;
552  case kUpb_CType_Message:
553  return UPB_SIZE(2, 3);
554  case kUpb_CType_Double:
555  case kUpb_CType_Int64:
556  case kUpb_CType_UInt64:
557  return 3;
558  case kUpb_CType_String:
559  case kUpb_CType_Bytes:
560  return UPB_SIZE(3, 4);
561  }
562  UPB_UNREACHABLE();
563 }
564 UPB_INLINE void* _upb_Array_Resize_accessor(void* msg, size_t ofs, size_t size,
567 }
569  size_t elem_size, upb_CType type,
570  const void* value,
571  upb_Arena* arena) {
572  (void)elem_size;
574  arena);
575 }
576 
579 /* Right now we use strmaps for everything. We'll likely want to use
580  * integer-specific maps for integer-keyed maps.*/
581 typedef struct {
582  /* Size of key and val, based on the map type. Strings are represented as '0'
583  * because they must be handled specially. */
584  char key_size;
585  char val_size;
586 
588 } upb_Map;
589 
590 /* Map entries aren't actually stored, they are only used during parsing. For
591  * parsing, it helps a lot if all map entry messages have the same layout.
592  * The compiler and def.c must ensure that all map entries have this layout. */
593 typedef struct {
595  union {
596  upb_StringView str; /* For str/bytes. */
597  upb_value val; /* For all other types. */
598  } k;
599  union {
600  upb_StringView str; /* For str/bytes. */
601  upb_value val; /* For all other types. */
602  } v;
603 } upb_MapEntry;
604 
605 /* Creates a new map on the given arena with this key/value type. */
606 upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
607 
608 /* Converting between internal table representation and user values.
609  *
610  * _upb_map_tokey() and _upb_map_fromkey() are inverses.
611  * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
612  *
613  * These functions account for the fact that strings are treated differently
614  * from other types when stored in a map.
615  */
616 
618  if (size == UPB_MAPTYPE_STRING) {
619  return *(upb_StringView*)key;
620  } else {
621  return upb_StringView_FromDataAndSize((const char*)key, size);
622  }
623 }
624 
626  if (size == UPB_MAPTYPE_STRING) {
627  memcpy(out, &key, sizeof(key));
628  } else {
629  memcpy(out, key.data, size);
630  }
631 }
632 
633 UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
634  upb_value* msgval, upb_Arena* a) {
635  if (size == UPB_MAPTYPE_STRING) {
636  upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
637  if (!strp) return false;
638  *strp = *(upb_StringView*)val;
639  *msgval = upb_value_ptr(strp);
640  } else {
641  memcpy(msgval, val, size);
642  }
643  return true;
644 }
645 
646 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
647  if (size == UPB_MAPTYPE_STRING) {
648  const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
649  memcpy(out, strp, sizeof(upb_StringView));
650  } else {
651  memcpy(out, &val, size);
652  }
653 }
654 
655 /* Map operations, shared by reflection and generated code. */
656 
658  return map->table.t.count;
659 }
660 
661 UPB_INLINE bool _upb_Map_Get(const upb_Map* map, const void* key,
662  size_t key_size, void* val, size_t val_size) {
663  upb_value tabval;
664  upb_StringView k = _upb_map_tokey(key, key_size);
665  bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
666  if (ret && val) {
667  _upb_map_fromvalue(tabval, val, val_size);
668  }
669  return ret;
670 }
671 
672 UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) {
674  it.t = &map->table;
675  it.index = *iter;
677  *iter = it.index;
678  if (upb_strtable_done(&it)) return NULL;
679  return (void*)str_tabent(&it);
680 }
681 
682 UPB_INLINE bool _upb_Map_Set(upb_Map* map, const void* key, size_t key_size,
683  void* val, size_t val_size, upb_Arena* a) {
684  upb_StringView strkey = _upb_map_tokey(key, key_size);
685  upb_value tabval = {0};
686  if (!_upb_map_tovalue(val, val_size, &tabval, a)) return false;
687 
688  /* TODO(haberman): add overwrite operation to minimize number of lookups. */
689  upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
690  return upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a);
691 }
692 
694  size_t key_size) {
695  upb_StringView k = _upb_map_tokey(key, key_size);
696  return upb_strtable_remove2(&map->table, k.data, k.size, NULL);
697 }
698 
700  upb_strtable_clear(&map->table);
701 }
702 
703 /* Message map operations, these get the map from the message first. */
704 
705 UPB_INLINE size_t _upb_msg_map_size(const upb_Message* msg, size_t ofs) {
706  upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
707  return map ? _upb_Map_Size(map) : 0;
708 }
709 
710 UPB_INLINE bool _upb_msg_map_get(const upb_Message* msg, size_t ofs,
711  const void* key, size_t key_size, void* val,
712  size_t val_size) {
713  upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
714  if (!map) return false;
715  return _upb_Map_Get(map, key, key_size, val, val_size);
716 }
717 
718 UPB_INLINE void* _upb_msg_map_next(const upb_Message* msg, size_t ofs,
719  size_t* iter) {
720  upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
721  if (!map) return NULL;
722  return _upb_map_next(map, iter);
723 }
724 
725 UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key,
726  size_t key_size, void* val, size_t val_size,
727  upb_Arena* arena) {
728  upb_Map** map = UPB_PTR_AT(msg, ofs, upb_Map*);
729  if (!*map) {
730  *map = _upb_Map_New(arena, key_size, val_size);
731  }
732  return _upb_Map_Set(*map, key, key_size, val, val_size, arena);
733 }
734 
736  const void* key, size_t key_size) {
737  upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
738  if (!map) return false;
739  return _upb_Map_Delete(map, key, key_size);
740 }
741 
743  upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
744  if (!map) return;
746 }
747 
748 /* Accessing map key/value from a pointer, used by generated code only. */
749 
750 UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
751  const upb_tabent* ent = (const upb_tabent*)msg;
752  uint32_t u32len;
754  k.data = upb_tabstr(ent->key, &u32len);
755  k.size = u32len;
757 }
758 
759 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
760  const upb_tabent* ent = (const upb_tabent*)msg;
761  upb_value v = {ent->val.val};
762  _upb_map_fromvalue(v, val, size);
763 }
764 
765 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
766  size_t size) {
767  upb_tabent* ent = (upb_tabent*)msg;
768  /* This is like _upb_map_tovalue() except the entry already exists so we can
769  * reuse the allocated upb_StringView for string fields. */
770  if (size == UPB_MAPTYPE_STRING) {
772  memcpy(strp, val, sizeof(*strp));
773  } else {
774  memcpy(&ent->val.val, val, size);
775  }
776 }
777 
780 /* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
781  * Since maps can be recursive (map values can be messages which contain other
782  * maps). _upb_mapsorter can contain a stack of maps. */
783 
784 typedef struct {
785  upb_tabent const** entries;
786  int size;
787  int cap;
789 
790 typedef struct {
791  int start;
792  int pos;
793  int end;
795 
797  s->entries = NULL;
798  s->size = 0;
799  s->cap = 0;
800 }
801 
803  if (s->entries) free(s->entries);
804 }
805 
807  const upb_Map* map, _upb_sortedmap* sorted);
808 
810  _upb_sortedmap* sorted) {
811  s->size = sorted->start;
812 }
813 
815  _upb_sortedmap* sorted, upb_MapEntry* ent) {
816  if (sorted->pos == sorted->end) return false;
817  const upb_tabent* tabent = s->entries[sorted->pos++];
819  _upb_map_fromkey(key, &ent->k, map->key_size);
820  upb_value val = {tabent->val.val};
821  _upb_map_fromvalue(val, &ent->v, map->val_size);
822  return true;
823 }
824 
825 #ifdef __cplusplus
826 } /* extern "C" */
827 #endif
828 
829 #include "upb/port_undef.inc"
830 
831 #endif /* UPB_MSG_INT_H_ */
_upb_FastTable_Entry::field_data
uint64_t field_data
Definition: msg_internal.h:132
xds_interop_client.str
str
Definition: xds_interop_client.py:487
upb_MiniTable_requiredmask
UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable *l)
Definition: msg_internal.h:223
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
upb_MiniTable_Enum::mask
uint64_t mask
Definition: msg_internal.h:138
upb_Array::size
size_t size
Definition: msg_internal.h:427
upb_Message_Extension::ptr
void * ptr
Definition: msg_internal.h:331
kUpb_CType_String
@ kUpb_CType_String
Definition: upb/upb/upb.h:296
kUpb_FieldRep_4Byte
@ kUpb_FieldRep_4Byte
Definition: msg_internal.h:101
_upb_Map_Delete
UPB_INLINE bool _upb_Map_Delete(upb_Map *map, const void *key, size_t key_size)
Definition: msg_internal.h:693
upb_FieldType
upb_FieldType
Definition: upb/upb/upb.h:308
kUpb_CType_UInt32
@ kUpb_CType_UInt32
Definition: upb/upb/upb.h:290
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
_upb_hasbit_field
UPB_INLINE bool _upb_hasbit_field(const upb_Message *msg, const upb_MiniTable_Field *f)
Definition: msg_internal.h:377
_UPB_MSGSET_TYPEID
@ _UPB_MSGSET_TYPEID
Definition: msg_internal.h:181
upb_CType
upb_CType
Definition: upb/upb/upb.h:286
regen-readme.it
it
Definition: regen-readme.py:15
upb_MiniTable_Sub
Definition: msg_internal.h:154
upb_MiniTable_File::exts
const upb_MiniTable_Extension ** exts
Definition: msg_internal.h:211
kUpb_CType_Int32
@ kUpb_CType_Int32
Definition: upb/upb/upb.h:289
upb_strtable_done
bool upb_strtable_done(const upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1645
pos
int pos
Definition: libuv/docs/code/tty-gravity/main.c:11
upb_Message_InternalData::size
uint32_t size
Definition: msg_internal.h:254
memset
return memset(p, 0, total)
_upb_extreg_add
bool _upb_extreg_add(upb_ExtensionRegistry *r, const upb_MiniTable_Extension **e, size_t count)
Definition: msg.c:392
upb_Decoder
Definition: decode_internal.h:48
_upb_UInt32_FromU
UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v)
Definition: msg_internal.h:59
_upb_msg_map_next
UPB_INLINE void * _upb_msg_map_next(const upb_Message *msg, size_t ofs, size_t *iter)
Definition: msg_internal.h:718
_upb_msg_map_value
UPB_INLINE void _upb_msg_map_value(const void *msg, void *val, size_t size)
Definition: msg_internal.h:759
upb_MiniTable_Sub::subenum
const upb_MiniTable_Enum * subenum
Definition: msg_internal.h:156
upb_MiniTable_File::enums
const upb_MiniTable_Enum ** enums
Definition: msg_internal.h:210
UPB_UNLIKELY
#define UPB_UNLIKELY(x)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:62
upb_MiniTable::fields
const upb_MiniTable_Field * fields
Definition: msg_internal.h:187
upb_MiniTable_Enum
Definition: msg_internal.h:136
upb_MiniTable_Field
Definition: msg_internal.h:71
_upb_sortedmap::end
int end
Definition: php-upb.h:1697
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
_upb_sortedmap::start
int start
Definition: php-upb.h:1695
upb_Message_InternalData::unknown_end
uint32_t unknown_end
Definition: msg_internal.h:269
_upb_getoneofcase_field
UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message *msg, const upb_MiniTable_Field *f)
Definition: msg_internal.h:412
kUpb_LabelFlags_IsPacked
@ kUpb_LabelFlags_IsPacked
Definition: msg_internal.h:94
_upb_Map_Size
UPB_INLINE size_t _upb_Map_Size(const upb_Map *map)
Definition: msg_internal.h:657
_upb_FieldParser
const typedef char * _upb_FieldParser(struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, uint64_t hasbits, uint64_t data)
upb_Message_InternalData
Definition: msg_internal.h:251
upb_MiniTable::dense_below
uint8_t dense_below
Definition: msg_internal.h:193
upb_StringView::data
const char * data
Definition: upb/upb/upb.h:73
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
string.h
upb_MiniTable_Sub::submsg
const struct upb_MiniTable * submsg
Definition: msg_internal.h:155
_upb_Message_Getorcreateext
upb_Message_Extension * _upb_Message_Getorcreateext(upb_Message *msg, const upb_MiniTable_Extension *ext, upb_Arena *arena)
Definition: msg.c:156
upb_FieldRep
upb_FieldRep
Definition: msg_internal.h:99
upb_MiniTable_Extension
Definition: msg_internal.h:202
kUpb_CType_Bytes
@ kUpb_CType_Bytes
Definition: upb/upb/upb.h:297
upb_MiniTable::ext
uint8_t ext
Definition: msg_internal.h:192
_upb_Message_New_inl
UPB_INLINE upb_Message * _upb_Message_New_inl(const upb_MiniTable *l, upb_Arena *a)
Definition: msg_internal.h:287
UPB_ALIGN_UP
#define UPB_ALIGN_UP(size, align)
Definition: php-upb.c:93
upb_MiniTable_Field::number
uint32_t number
Definition: msg_internal.h:72
UPB_UNREACHABLE
#define UPB_UNREACHABLE()
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:145
upb_Message_Extension::ext
const upb_MiniTable_Extension * ext
Definition: msg_internal.h:328
_upb_Message_AddUnknown
bool _upb_Message_AddUnknown(upb_Message *msg, const char *data, size_t len, upb_Arena *arena)
Definition: msg.c:85
_upb_Array_Resize_accessor
UPB_INLINE void * _upb_Array_Resize_accessor(void *msg, size_t ofs, size_t size, upb_CType type, upb_Arena *arena)
Definition: msg_internal.h:564
upb_Message_Getinternal
UPB_INLINE upb_Message_Internal * upb_Message_Getinternal(upb_Message *msg)
Definition: msg_internal.h:301
upb_MiniTable
Definition: msg_internal.h:185
_upb_sethas
UPB_INLINE void _upb_sethas(const upb_Message *msg, size_t idx)
Definition: msg_internal.h:364
upb_tabstr
UPB_INLINE char * upb_tabstr(upb_tabkey key, uint32_t *len)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:789
upb_msgext_fieldnum
upb_msgext_fieldnum
Definition: msg_internal.h:179
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
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_array_detach
UPB_INLINE void _upb_array_detach(const void *msg, size_t ofs)
Definition: msg_internal.h:485
upb_Array::junk
uint64_t junk
Definition: msg_internal.h:428
_upb_oneofcase
UPB_INLINE uint32_t * _upb_oneofcase(upb_Message *msg, size_t case_ofs)
Definition: msg_internal.h:394
_upb_Map_Set
UPB_INLINE bool _upb_Map_Set(upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *a)
Definition: msg_internal.h:682
UPB_PTR_AT
#define UPB_PTR_AT(msg, ofs, type)
Definition: php-upb.c:71
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
_upb_map_tovalue
UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval, upb_Arena *a)
Definition: msg_internal.h:633
setup.k
k
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
upb_MiniTable::fasttable
_upb_FastTable_Entry fasttable[]
Definition: msg_internal.h:199
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
kUpb_CType_Int64
@ kUpb_CType_Int64
Definition: upb/upb/upb.h:294
kUpb_FieldRep_Max
@ kUpb_FieldRep_Max
Definition: msg_internal.h:107
upb_LabelFlags
upb_LabelFlags
Definition: msg_internal.h:93
upb_FieldMode
upb_FieldMode
Definition: msg_internal.h:83
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
_upb_array_reserve
UPB_INLINE bool _upb_array_reserve(upb_Array *arr, size_t size, upb_Arena *arena)
Definition: msg_internal.h:472
msg.h
kUpb_LabelFlags_IsExtension
@ kUpb_LabelFlags_IsExtension
Definition: msg_internal.h:95
upb_MapEntry::k
union upb_MapEntry::@708 k
_UPB_MSGSET_ITEM
@ _UPB_MSGSET_ITEM
Definition: msg_internal.h:180
_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_msg_map_delete
UPB_INLINE bool _upb_msg_map_delete(upb_Message *msg, size_t ofs, const void *key, size_t key_size)
Definition: msg_internal.h:735
kUpb_ExtMode_NonExtendable
@ kUpb_ExtMode_NonExtendable
Definition: msg_internal.h:160
_upb_Map_New
upb_Map * _upb_Map_New(upb_Arena *a, size_t key_size, size_t value_size)
Definition: msg.c:236
_upb_map_fromvalue
UPB_INLINE void _upb_map_fromvalue(upb_value val, void *out, size_t size)
Definition: msg_internal.h:646
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
_upb_msg_map_get
UPB_INLINE bool _upb_msg_map_get(const upb_Message *msg, size_t ofs, const void *key, size_t key_size, void *val, size_t val_size)
Definition: msg_internal.h:710
_upb_sizelg2
UPB_INLINE int _upb_sizelg2(upb_CType type)
Definition: msg_internal.h:543
_upb_Message_Clearext
void _upb_Message_Clearext(upb_Message *msg, const upb_MiniTable_Extension *ext)
Definition: msg.c:142
ULL
#define ULL(x)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:57
_upb_clearhas_field
UPB_INLINE void _upb_clearhas_field(const upb_Message *msg, const upb_MiniTable_Field *f)
Definition: msg_internal.h:387
upb_Message_Internal
Definition: msg_internal.h:275
upb_MiniTable_Field::presence
int16_t presence
Definition: msg_internal.h:74
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
_upb_map_fromkey
UPB_INLINE void _upb_map_fromkey(upb_StringView key, void *out, size_t size)
Definition: msg_internal.h:625
start
static uint64_t start
Definition: benchmark-pound.c:74
_upb_Map_Get
UPB_INLINE bool _upb_Map_Get(const upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size)
Definition: msg_internal.h:661
_upb_has_submsg_nohasbit
UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_Message *msg, size_t ofs)
Definition: msg_internal.h:417
kUpb_FieldRep_8Byte
@ kUpb_FieldRep_8Byte
Definition: msg_internal.h:104
autogen_x86imm.f
f
Definition: autogen_x86imm.py:9
int16_t
signed short int16_t
Definition: stdint-msvc2008.h:76
upb_MiniTable::subs
const upb_MiniTable_Sub * subs
Definition: msg_internal.h:186
_upb_Message_Getexts
const upb_Message_Extension * _upb_Message_Getexts(const upb_Message *msg, size_t *count)
Definition: msg.c:112
kUpb_ExtMode_IsMapEntry
@ kUpb_ExtMode_IsMapEntry
Definition: msg_internal.h:168
_upb_map_next
UPB_INLINE void * _upb_map_next(const upb_Map *map, size_t *iter)
Definition: msg_internal.h:672
_upb_mapsorter_popmap
UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter *s, _upb_sortedmap *sorted)
Definition: msg_internal.h:809
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
kUpb_CType_Double
@ kUpb_CType_Double
Definition: upb/upb/upb.h:293
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
_upb_sortedmap::pos
int pos
Definition: php-upb.h:1696
upb_StringView::size
size_t size
Definition: upb/upb/upb.h:74
_upb_Array_Append_accessor2
UPB_INLINE bool _upb_Array_Append_accessor2(void *msg, size_t ofs, int elem_size_lg2, const void *value, upb_Arena *arena)
Definition: msg_internal.h:525
_upb_tabent::val
upb_tabval val
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:809
upb_IsRepeatedOrMap
UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field *field)
Definition: msg_internal.h:114
upb_MiniTable::field_count
uint16_t field_count
Definition: msg_internal.h:191
upb_Message_Extension
Definition: msg_internal.h:327
upb.h
_upb_array_realloc
bool _upb_array_realloc(upb_Array *arr, size_t min_size, upb_Arena *arena)
Definition: msg.c:178
upb_MiniTable_Enum_CheckValue
UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum *e, int32_t val)
Definition: msg_internal.h:142
upb_MiniTable::table_mask
uint8_t table_mask
Definition: msg_internal.h:194
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
upb_Array
Definition: msg_internal.h:424
UPB_SIZE
#define UPB_SIZE(size32, size64)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:32
upb_Arena_Malloc
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
Definition: upb/upb/upb.h:222
_upb_Message_Clear
void _upb_Message_Clear(upb_Message *msg, const upb_MiniTable *l)
Definition: msg.c:48
upb_MiniTable_Extension::sub
upb_MiniTable_Sub sub
Definition: msg_internal.h:205
_upb_oneofcase_ofs
UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTable_Field *f)
Definition: msg_internal.h:402
UPB_INLINE
#define UPB_INLINE
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:53
table_internal.h
_upb_hasbit
UPB_INLINE bool _upb_hasbit(const upb_Message *msg, size_t idx)
Definition: msg_internal.h:360
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
upb_MapEntry::v
union upb_MapEntry::@709 v
upb_FieldMode_Get
UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTable_Field *field)
Definition: msg_internal.h:110
_upb_Map_Clear
UPB_INLINE void _upb_Map_Clear(upb_Map *map)
Definition: msg_internal.h:699
_upb_array_accessor
const UPB_INLINE void * _upb_array_accessor(const void *msg, size_t ofs, size_t *size)
Definition: msg_internal.h:489
upb_MiniTable_File
Definition: msg_internal.h:208
upb_Map::table
upb_strtable table
Definition: msg_internal.h:587
kUpb_FieldRep_Shift
@ kUpb_FieldRep_Shift
Definition: msg_internal.h:106
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
UPB_ASSERT
#define UPB_ASSERT(expr)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:135
kUpb_FieldMode_Map
@ kUpb_FieldMode_Map
Definition: msg_internal.h:84
upb_strtable_next
void upb_strtable_next(upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1641
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
upb_MiniTable_Field::offset
uint16_t offset
Definition: msg_internal.h:73
_upb_UInt64_FromULL
UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v)
Definition: msg_internal.h:61
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
upb_MiniTable_Enum::values
const int32_t * values
Definition: msg_internal.h:137
upb_MiniTable_Extension::field
upb_MiniTable_Field field
Definition: msg_internal.h:203
_upb_array_mutable_accessor
UPB_INLINE void * _upb_array_mutable_accessor(void *msg, size_t ofs, size_t *size)
Definition: msg_internal.h:501
kUpb_ExtMode_Extendable
@ kUpb_ExtMode_Extendable
Definition: msg_internal.h:161
d
static const fe d
Definition: curve25519_tables.h:19
upb_MapEntry
Definition: msg_internal.h:593
upb_Message
void upb_Message
Definition: msg.h:49
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
_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
stdint.h
setup.idx
idx
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:197
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
_upb_Message_Getext
const upb_Message_Extension * _upb_Message_Getext(const upb_Message *msg, const upb_MiniTable_Extension *ext)
Definition: msg.c:125
upb_Message_InternalData::ext_begin
uint32_t ext_begin
Definition: msg_internal.h:270
upb_MiniTable_Extension::extendee
const upb_MiniTable * extendee
Definition: msg_internal.h:204
_upb_Message_New
upb_Message * _upb_Message_New(const upb_MiniTable *l, upb_Arena *a)
Definition: msg.c:44
_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
_upb_array_constptr
const UPB_INLINE void * _upb_array_constptr(const upb_Array *arr)
Definition: msg_internal.h:431
kUpb_CType_Float
@ kUpb_CType_Float
Definition: upb/upb/upb.h:288
upb_MapEntry::val
upb_value val
Definition: msg_internal.h:597
_upb_array_tagptr
UPB_INLINE uintptr_t _upb_array_tagptr(void *ptr, int elem_size_lg2)
Definition: msg_internal.h:436
upb_MiniTable_Field::mode
uint8_t mode
Definition: msg_internal.h:77
mem
void * mem
Definition: libc.cpp:91
upb_Array::data
uintptr_t data
Definition: msg_internal.h:425
upb_MiniTable_Field::descriptortype
uint8_t descriptortype
Definition: msg_internal.h:76
value
const char * value
Definition: hpack_parser_table.cc:165
_upb_msg_map_set
UPB_INLINE bool _upb_msg_map_set(upb_Message *msg, size_t ofs, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *arena)
Definition: msg_internal.h:725
upb_MiniTable_File::msgs
const upb_MiniTable ** msgs
Definition: msg_internal.h:209
upb_Map::val_size
char val_size
Definition: msg_internal.h:585
kUpb_FieldMode_Scalar
@ kUpb_FieldMode_Scalar
Definition: msg_internal.h:86
UPB_MAPTYPE_STRING
#define UPB_MAPTYPE_STRING
Definition: php-upb.c:82
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
key
const char * key
Definition: hpack_parser_table.cc:164
kUpb_ExtMode_IsMessageSet_ITEM
@ kUpb_ExtMode_IsMessageSet_ITEM
Definition: msg_internal.h:163
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
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
_upb_mapsorter_destroy
UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter *s)
Definition: msg_internal.h:802
upb_Map::key_size
char key_size
Definition: msg_internal.h:584
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
upb_Message_Extension::str
upb_StringView str
Definition: msg_internal.h:330
str_tabent
static const upb_tabent * str_tabent(const upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1632
_upb_tabent
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:807
_upb_sethas_field
UPB_INLINE void _upb_sethas_field(const upb_Message *msg, const upb_MiniTable_Field *f)
Definition: msg_internal.h:382
_upb_Message_DiscardUnknown_shallow
void _upb_Message_DiscardUnknown_shallow(upb_Message *msg)
Definition: msg.c:94
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
_upb_array_ptr
UPB_INLINE void * _upb_array_ptr(upb_Array *arr)
Definition: msg_internal.h:441
kUpb_FieldType_Group
@ kUpb_FieldType_Group
Definition: upb/upb/upb.h:318
upb_MiniTable::size
uint16_t size
Definition: msg_internal.h:190
upb_Array::len
size_t len
Definition: msg_internal.h:426
_upb_Array_Append_accessor
UPB_INLINE bool _upb_Array_Append_accessor(void *msg, size_t ofs, size_t elem_size, upb_CType type, const void *value, upb_Arena *arena)
Definition: msg_internal.h:568
fix_build_deps.r
r
Definition: fix_build_deps.py:491
upb_msg_sizeof
UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable *l)
Definition: msg_internal.h:283
upb_StringView_FromDataAndSize
UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char *data, size_t size)
Definition: upb/upb/upb.h:77
_upb_msg_map_size
UPB_INLINE size_t _upb_msg_map_size(const upb_Message *msg, size_t ofs)
Definition: msg_internal.h:705
upb_MiniTable_File::ext_count
int ext_count
Definition: msg_internal.h:214
kUpb_ExtMode_IsMessageSet
@ kUpb_ExtMode_IsMessageSet
Definition: msg_internal.h:162
_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
_upb_msg_map_clear
UPB_INLINE void _upb_msg_map_clear(upb_Message *msg, size_t ofs)
Definition: msg_internal.h:742
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_tag_arrptr
UPB_INLINE uintptr_t _upb_tag_arrptr(void *ptr, int elem_size_lg2)
Definition: msg_internal.h:445
_upb_Int32_FromI
UPB_INLINE int32_t _upb_Int32_FromI(int v)
Definition: msg_internal.h:55
_upb_mapsorter_init
UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter *s)
Definition: msg_internal.h:796
upb_strtable_clear
void upb_strtable_clear(upb_strtable *t)
Definition: php-upb.c:2288
upb_ExtMode
upb_ExtMode
Definition: msg_internal.h:159
upb_strtable
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:844
upb_MiniTable_File::msg_count
int msg_count
Definition: msg_internal.h:212
_upb_map_tokey
UPB_INLINE upb_StringView _upb_map_tokey(const void *key, size_t size)
Definition: msg_internal.h:617
upb_tabval::val
uint64_t val
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:799
kUpb_FieldType_Message
@ kUpb_FieldType_Message
Definition: upb/upb/upb.h:319
upb_MiniTable::required_count
uint8_t required_count
Definition: msg_internal.h:195
_upb_Array_Resize_accessor2
UPB_INLINE void * _upb_Array_Resize_accessor2(void *msg, size_t ofs, size_t size, int elem_size_lg2, upb_Arena *arena)
Definition: msg_internal.h:513
_upb_msg_map_set_value
UPB_INLINE void _upb_msg_map_set_value(void *msg, const void *val, size_t size)
Definition: msg_internal.h:765
kUpb_CType_Bool
@ kUpb_CType_Bool
Definition: upb/upb/upb.h:287
upb_MiniTable_File::enum_count
int enum_count
Definition: msg_internal.h:213
_upb_oneofcase_field
UPB_INLINE uint32_t * _upb_oneofcase_field(upb_Message *msg, const upb_MiniTable_Field *f)
Definition: msg_internal.h:407
kUpb_CType_Enum
@ kUpb_CType_Enum
Definition: upb/upb/upb.h:291
_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
upb_Map
Definition: msg_internal.h:581
_UPB_MSGSET_MESSAGE
@ _UPB_MSGSET_MESSAGE
Definition: msg_internal.h:182
table
uint8_t table[256]
Definition: hpack_parser.cc:456
_upb_Int64_FromLL
UPB_INLINE int64_t _upb_Int64_FromLL(long long v)
Definition: msg_internal.h:57
iter
Definition: test_winkernel.cpp:47
_upb_Message_Hasidx
UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTable_Field *f)
Definition: msg_internal.h:372
_upb_sortedmap
Definition: php-upb.h:1694
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
upb_IsSubMessage
UPB_INLINE bool upb_IsSubMessage(const upb_MiniTable_Field *field)
Definition: msg_internal.h:119
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
kUpb_FieldRep_Pointer
@ kUpb_FieldRep_Pointer
Definition: msg_internal.h:103
kUpb_CType_UInt64
@ kUpb_CType_UInt64
Definition: upb/upb/upb.h:295
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
upb_strtable_iter
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:1086
_upb_tabent::key
upb_tabkey key
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:808
upb_MiniTable_Enum::value_count
int value_count
Definition: msg_internal.h:139
kUpb_FieldRep_1Byte
@ kUpb_FieldRep_1Byte
Definition: msg_internal.h:100
key_type
upb_fieldtype_t key_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1071
kUpb_FieldRep_StringView
@ kUpb_FieldRep_StringView
Definition: msg_internal.h:102
upb_MapEntry::str
upb_StringView str
Definition: msg_internal.h:596
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
upb_MiniTable_Field::submsg_index
uint16_t submsg_index
Definition: msg_internal.h:75
_upb_clearhas
UPB_INLINE void _upb_clearhas(const upb_Message *msg, size_t idx)
Definition: msg_internal.h:368
kUpb_FieldMode_Array
@ kUpb_FieldMode_Array
Definition: msg_internal.h:85
_upb_FastTable_Entry::field_parser
_upb_FieldParser * field_parser
Definition: msg_internal.h:133
_upb_msg_map_key
UPB_INLINE void _upb_msg_map_key(const void *msg, void *key, size_t size)
Definition: msg_internal.h:750
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
upb_Arena
Definition: upb_internal.h:36
_upb_CTypeo_size
char _upb_CTypeo_size[12]
_upb_sortedmap_next
UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter *s, const upb_Map *map, _upb_sortedmap *sorted, upb_MapEntry *ent)
Definition: msg_internal.h:814
upb_ExtensionRegistry
Definition: msg.c:372
_upb_FastTable_Entry
Definition: msg_internal.h:131
kUpb_CType_Message
@ kUpb_CType_Message
Definition: upb/upb/upb.h:292
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
_upb_getoneofcase
UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs)
Definition: msg_internal.h:398


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