google-protobuf 3.22.0.rc.2 → 3.22.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1424,179 +1424,6 @@ UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
1424
1424
  #include <stdlib.h>
1425
1425
 
1426
1426
 
1427
- #ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
1428
- #define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
1429
-
1430
-
1431
- // Must be last.
1432
-
1433
- struct upb_Decoder;
1434
- typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1435
- upb_Message* msg, intptr_t table,
1436
- uint64_t hasbits, uint64_t data);
1437
- typedef struct {
1438
- uint64_t field_data;
1439
- _upb_FieldParser* field_parser;
1440
- } _upb_FastTable_Entry;
1441
-
1442
- typedef enum {
1443
- kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
1444
- kUpb_ExtMode_Extendable = 1, // Normal extendable message.
1445
- kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
1446
- kUpb_ExtMode_IsMessageSet_ITEM =
1447
- 3, // MessageSet item (temporary only, see decode.c)
1448
-
1449
- // During table building we steal a bit to indicate that the message is a map
1450
- // entry. *Only* used during table building!
1451
- kUpb_ExtMode_IsMapEntry = 4,
1452
- } upb_ExtMode;
1453
-
1454
- // upb_MiniTable represents the memory layout of a given upb_MessageDef.
1455
- // The members are public so generated code can initialize them,
1456
- // but users MUST NOT directly read or write any of its members.
1457
- struct upb_MiniTable {
1458
- const upb_MiniTableSub* subs;
1459
- const upb_MiniTableField* fields;
1460
-
1461
- // Must be aligned to sizeof(void*). Doesn't include internal members like
1462
- // unknown fields, extension dict, pointer to msglayout, etc.
1463
- uint16_t size;
1464
-
1465
- uint16_t field_count;
1466
- uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
1467
- uint8_t dense_below;
1468
- uint8_t table_mask;
1469
- uint8_t required_count; // Required fields have the lowest hasbits.
1470
-
1471
- // To statically initialize the tables of variable length, we need a flexible
1472
- // array member, and we need to compile in gnu99 mode (constant initialization
1473
- // of flexible array members is a GNU extension, not in C99 unfortunately.
1474
- _upb_FastTable_Entry fasttable[];
1475
- };
1476
-
1477
- // Map entries aren't actually stored for map fields, they are only used during
1478
- // parsing. For parsing, it helps a lot if all map entry messages have the same
1479
- // layout. The layout code in mini_table/decode.c will ensure that all map
1480
- // entries have this layout.
1481
- //
1482
- // Note that users can and do create map entries directly, which will also use
1483
- // this layout.
1484
- //
1485
- // NOTE: sync with mini_table/decode.c.
1486
- typedef struct {
1487
- // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
1488
- // and the uint64_t helps make this clear.
1489
- uint64_t hasbits;
1490
- union {
1491
- upb_StringView str; // For str/bytes.
1492
- upb_value val; // For all other types.
1493
- } k;
1494
- union {
1495
- upb_StringView str; // For str/bytes.
1496
- upb_value val; // For all other types.
1497
- } v;
1498
- } upb_MapEntryData;
1499
-
1500
- typedef struct {
1501
- void* internal_data;
1502
- upb_MapEntryData data;
1503
- } upb_MapEntry;
1504
-
1505
- #ifdef __cplusplus
1506
- extern "C" {
1507
- #endif
1508
-
1509
- // Computes a bitmask in which the |l->required_count| lowest bits are set,
1510
- // except that we skip the lowest bit (because upb never uses hasbit 0).
1511
- //
1512
- // Sample output:
1513
- // requiredmask(1) => 0b10 (0x2)
1514
- // requiredmask(5) => 0b111110 (0x3e)
1515
- UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
1516
- int n = l->required_count;
1517
- assert(0 < n && n <= 63);
1518
- return ((1ULL << n) - 1) << 1;
1519
- }
1520
-
1521
- #ifdef __cplusplus
1522
- } /* extern "C" */
1523
- #endif
1524
-
1525
-
1526
- #endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
1527
-
1528
- // Must be last.
1529
-
1530
- #ifdef __cplusplus
1531
- extern "C" {
1532
- #endif
1533
-
1534
- // _upb_mapsorter sorts maps and provides ordered iteration over the entries.
1535
- // Since maps can be recursive (map values can be messages which contain other
1536
- // maps), _upb_mapsorter can contain a stack of maps.
1537
-
1538
- typedef struct {
1539
- upb_tabent const** entries;
1540
- int size;
1541
- int cap;
1542
- } _upb_mapsorter;
1543
-
1544
- typedef struct {
1545
- int start;
1546
- int pos;
1547
- int end;
1548
- } _upb_sortedmap;
1549
-
1550
- UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
1551
- s->entries = NULL;
1552
- s->size = 0;
1553
- s->cap = 0;
1554
- }
1555
-
1556
- UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
1557
- if (s->entries) free(s->entries);
1558
- }
1559
-
1560
- UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
1561
- _upb_sortedmap* sorted, upb_MapEntry* ent) {
1562
- if (sorted->pos == sorted->end) return false;
1563
- const upb_tabent* tabent = s->entries[sorted->pos++];
1564
- upb_StringView key = upb_tabstrview(tabent->key);
1565
- _upb_map_fromkey(key, &ent->data.k, map->key_size);
1566
- upb_value val = {tabent->val.val};
1567
- _upb_map_fromvalue(val, &ent->data.v, map->val_size);
1568
- return true;
1569
- }
1570
-
1571
- UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
1572
- _upb_sortedmap* sorted) {
1573
- s->size = sorted->start;
1574
- }
1575
-
1576
- bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
1577
- const upb_Map* map, _upb_sortedmap* sorted);
1578
-
1579
- #ifdef __cplusplus
1580
- } /* extern "C" */
1581
- #endif
1582
-
1583
-
1584
- #endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
1585
-
1586
- /*
1587
- ** Our memory representation for parsing tables and messages themselves.
1588
- ** Functions in this file are used by generated code and possibly reflection.
1589
- **
1590
- ** The definitions in this file are internal to upb.
1591
- **/
1592
-
1593
- #ifndef UPB_MESSAGE_INTERNAL_H_
1594
- #define UPB_MESSAGE_INTERNAL_H_
1595
-
1596
- #include <stdlib.h>
1597
- #include <string.h>
1598
-
1599
-
1600
1427
  #ifndef UPB_MESSAGE_EXTENSION_INTERNAL_H_
1601
1428
  #define UPB_MESSAGE_EXTENSION_INTERNAL_H_
1602
1429
 
@@ -1813,7 +1640,9 @@ union upb_MiniTableSub {
1813
1640
  // Must be last.
1814
1641
 
1815
1642
  struct upb_MiniTableExtension {
1643
+ // Do not move this field. We need to be able to alias pointers.
1816
1644
  upb_MiniTableField field;
1645
+
1817
1646
  const upb_MiniTable* extendee;
1818
1647
  upb_MiniTableSub sub; // NULL unless submessage or proto2 enum
1819
1648
  };
@@ -1867,6 +1696,191 @@ const upb_Message_Extension* _upb_Message_Getext(
1867
1696
 
1868
1697
  #endif /* UPB_MESSAGE_EXTENSION_INTERNAL_H_ */
1869
1698
 
1699
+ #ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
1700
+ #define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
1701
+
1702
+
1703
+ // Must be last.
1704
+
1705
+ struct upb_Decoder;
1706
+ typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1707
+ upb_Message* msg, intptr_t table,
1708
+ uint64_t hasbits, uint64_t data);
1709
+ typedef struct {
1710
+ uint64_t field_data;
1711
+ _upb_FieldParser* field_parser;
1712
+ } _upb_FastTable_Entry;
1713
+
1714
+ typedef enum {
1715
+ kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
1716
+ kUpb_ExtMode_Extendable = 1, // Normal extendable message.
1717
+ kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
1718
+ kUpb_ExtMode_IsMessageSet_ITEM =
1719
+ 3, // MessageSet item (temporary only, see decode.c)
1720
+
1721
+ // During table building we steal a bit to indicate that the message is a map
1722
+ // entry. *Only* used during table building!
1723
+ kUpb_ExtMode_IsMapEntry = 4,
1724
+ } upb_ExtMode;
1725
+
1726
+ // upb_MiniTable represents the memory layout of a given upb_MessageDef.
1727
+ // The members are public so generated code can initialize them,
1728
+ // but users MUST NOT directly read or write any of its members.
1729
+ struct upb_MiniTable {
1730
+ const upb_MiniTableSub* subs;
1731
+ const upb_MiniTableField* fields;
1732
+
1733
+ // Must be aligned to sizeof(void*). Doesn't include internal members like
1734
+ // unknown fields, extension dict, pointer to msglayout, etc.
1735
+ uint16_t size;
1736
+
1737
+ uint16_t field_count;
1738
+ uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
1739
+ uint8_t dense_below;
1740
+ uint8_t table_mask;
1741
+ uint8_t required_count; // Required fields have the lowest hasbits.
1742
+
1743
+ // To statically initialize the tables of variable length, we need a flexible
1744
+ // array member, and we need to compile in gnu99 mode (constant initialization
1745
+ // of flexible array members is a GNU extension, not in C99 unfortunately.
1746
+ _upb_FastTable_Entry fasttable[];
1747
+ };
1748
+
1749
+ // Map entries aren't actually stored for map fields, they are only used during
1750
+ // parsing. For parsing, it helps a lot if all map entry messages have the same
1751
+ // layout. The layout code in mini_table/decode.c will ensure that all map
1752
+ // entries have this layout.
1753
+ //
1754
+ // Note that users can and do create map entries directly, which will also use
1755
+ // this layout.
1756
+ //
1757
+ // NOTE: sync with mini_table/decode.c.
1758
+ typedef struct {
1759
+ // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
1760
+ // and the uint64_t helps make this clear.
1761
+ uint64_t hasbits;
1762
+ union {
1763
+ upb_StringView str; // For str/bytes.
1764
+ upb_value val; // For all other types.
1765
+ } k;
1766
+ union {
1767
+ upb_StringView str; // For str/bytes.
1768
+ upb_value val; // For all other types.
1769
+ } v;
1770
+ } upb_MapEntryData;
1771
+
1772
+ typedef struct {
1773
+ void* internal_data;
1774
+ upb_MapEntryData data;
1775
+ } upb_MapEntry;
1776
+
1777
+ #ifdef __cplusplus
1778
+ extern "C" {
1779
+ #endif
1780
+
1781
+ // Computes a bitmask in which the |l->required_count| lowest bits are set,
1782
+ // except that we skip the lowest bit (because upb never uses hasbit 0).
1783
+ //
1784
+ // Sample output:
1785
+ // requiredmask(1) => 0b10 (0x2)
1786
+ // requiredmask(5) => 0b111110 (0x3e)
1787
+ UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
1788
+ int n = l->required_count;
1789
+ assert(0 < n && n <= 63);
1790
+ return ((1ULL << n) - 1) << 1;
1791
+ }
1792
+
1793
+ #ifdef __cplusplus
1794
+ } /* extern "C" */
1795
+ #endif
1796
+
1797
+
1798
+ #endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
1799
+
1800
+ // Must be last.
1801
+
1802
+ #ifdef __cplusplus
1803
+ extern "C" {
1804
+ #endif
1805
+
1806
+ // _upb_mapsorter sorts maps and provides ordered iteration over the entries.
1807
+ // Since maps can be recursive (map values can be messages which contain other
1808
+ // maps), _upb_mapsorter can contain a stack of maps.
1809
+
1810
+ typedef struct {
1811
+ void const** entries;
1812
+ int size;
1813
+ int cap;
1814
+ } _upb_mapsorter;
1815
+
1816
+ typedef struct {
1817
+ int start;
1818
+ int pos;
1819
+ int end;
1820
+ } _upb_sortedmap;
1821
+
1822
+ UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
1823
+ s->entries = NULL;
1824
+ s->size = 0;
1825
+ s->cap = 0;
1826
+ }
1827
+
1828
+ UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
1829
+ if (s->entries) free(s->entries);
1830
+ }
1831
+
1832
+ UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
1833
+ _upb_sortedmap* sorted, upb_MapEntry* ent) {
1834
+ if (sorted->pos == sorted->end) return false;
1835
+ const upb_tabent* tabent = (const upb_tabent*)s->entries[sorted->pos++];
1836
+ upb_StringView key = upb_tabstrview(tabent->key);
1837
+ _upb_map_fromkey(key, &ent->data.k, map->key_size);
1838
+ upb_value val = {tabent->val.val};
1839
+ _upb_map_fromvalue(val, &ent->data.v, map->val_size);
1840
+ return true;
1841
+ }
1842
+
1843
+ UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s,
1844
+ _upb_sortedmap* sorted,
1845
+ const upb_Message_Extension** ext) {
1846
+ if (sorted->pos == sorted->end) return false;
1847
+ *ext = (const upb_Message_Extension*)s->entries[sorted->pos++];
1848
+ return true;
1849
+ }
1850
+
1851
+ UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
1852
+ _upb_sortedmap* sorted) {
1853
+ s->size = sorted->start;
1854
+ }
1855
+
1856
+ bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
1857
+ const upb_Map* map, _upb_sortedmap* sorted);
1858
+
1859
+ bool _upb_mapsorter_pushexts(_upb_mapsorter* s,
1860
+ const upb_Message_Extension* exts, size_t count,
1861
+ _upb_sortedmap* sorted);
1862
+
1863
+ #ifdef __cplusplus
1864
+ } /* extern "C" */
1865
+ #endif
1866
+
1867
+
1868
+ #endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
1869
+
1870
+ /*
1871
+ ** Our memory representation for parsing tables and messages themselves.
1872
+ ** Functions in this file are used by generated code and possibly reflection.
1873
+ **
1874
+ ** The definitions in this file are internal to upb.
1875
+ **/
1876
+
1877
+ #ifndef UPB_MESSAGE_INTERNAL_H_
1878
+ #define UPB_MESSAGE_INTERNAL_H_
1879
+
1880
+ #include <stdlib.h>
1881
+ #include <string.h>
1882
+
1883
+
1870
1884
  #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
1871
1885
  #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
1872
1886
 
@@ -2253,6 +2267,26 @@ UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
2253
2267
  return mini_table->subs[field->submsg_index].subenum;
2254
2268
  }
2255
2269
 
2270
+ // If this field is in a oneof, returns the first field in the oneof.
2271
+ //
2272
+ // Otherwise returns NULL.
2273
+ //
2274
+ // Usage:
2275
+ // const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f);
2276
+ // do {
2277
+ // ..
2278
+ // } while (upb_MiniTable_NextOneofField(m, &field);
2279
+ //
2280
+ const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m,
2281
+ const upb_MiniTableField* f);
2282
+
2283
+ // Returns the next field in the oneof. If this is the last field in the
2284
+ // oneof, returns NULL. The ordering of fields in the oneof is not
2285
+ // guaranteed.
2286
+ // REQUIRES: |iter| is and iterator.
2287
+ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
2288
+ const upb_MiniTableField** f);
2289
+
2256
2290
  #ifdef __cplusplus
2257
2291
  } /* extern "C" */
2258
2292
  #endif
@@ -2942,6 +2976,8 @@ typedef struct {
2942
2976
  //
2943
2977
  // The unknown data is removed from message after field value is set
2944
2978
  // using upb_Message_SetMessage.
2979
+ //
2980
+ // WARNING!: See b/267655898
2945
2981
  upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage(
2946
2982
  upb_Message* msg, const upb_MiniTable* mini_table,
2947
2983
  const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table,
@@ -3289,6 +3325,12 @@ extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init;
3289
3325
  extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init;
3290
3326
  extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init;
3291
3327
 
3328
+ typedef enum {
3329
+ google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
3330
+ google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
3331
+ google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
3332
+ } google_protobuf_FieldDescriptorProto_Label;
3333
+
3292
3334
  typedef enum {
3293
3335
  google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
3294
3336
  google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
@@ -3310,18 +3352,6 @@ typedef enum {
3310
3352
  google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
3311
3353
  } google_protobuf_FieldDescriptorProto_Type;
3312
3354
 
3313
- typedef enum {
3314
- google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
3315
- google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
3316
- google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
3317
- } google_protobuf_FieldDescriptorProto_Label;
3318
-
3319
- typedef enum {
3320
- google_protobuf_FileOptions_SPEED = 1,
3321
- google_protobuf_FileOptions_CODE_SIZE = 2,
3322
- google_protobuf_FileOptions_LITE_RUNTIME = 3
3323
- } google_protobuf_FileOptions_OptimizeMode;
3324
-
3325
3355
  typedef enum {
3326
3356
  google_protobuf_FieldOptions_STRING = 0,
3327
3357
  google_protobuf_FieldOptions_CORD = 1,
@@ -3354,10 +3384,10 @@ typedef enum {
3354
3384
  } google_protobuf_FieldOptions_OptionTargetType;
3355
3385
 
3356
3386
  typedef enum {
3357
- google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
3358
- google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
3359
- google_protobuf_MethodOptions_IDEMPOTENT = 2
3360
- } google_protobuf_MethodOptions_IdempotencyLevel;
3387
+ google_protobuf_FileOptions_SPEED = 1,
3388
+ google_protobuf_FileOptions_CODE_SIZE = 2,
3389
+ google_protobuf_FileOptions_LITE_RUNTIME = 3
3390
+ } google_protobuf_FileOptions_OptimizeMode;
3361
3391
 
3362
3392
  typedef enum {
3363
3393
  google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0,
@@ -3365,16 +3395,22 @@ typedef enum {
3365
3395
  google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2
3366
3396
  } google_protobuf_GeneratedCodeInfo_Annotation_Semantic;
3367
3397
 
3398
+ typedef enum {
3399
+ google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
3400
+ google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
3401
+ google_protobuf_MethodOptions_IDEMPOTENT = 2
3402
+ } google_protobuf_MethodOptions_IdempotencyLevel;
3403
+
3368
3404
 
3369
- extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init;
3370
3405
  extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init;
3371
- extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init;
3406
+ extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init;
3372
3407
  extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init;
3373
3408
  extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init;
3374
3409
  extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init;
3375
3410
  extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init;
3376
- extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init;
3411
+ extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init;
3377
3412
  extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init;
3413
+ extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init;
3378
3414
 
3379
3415
  /* google.protobuf.FileDescriptorSet */
3380
3416
 
@@ -8777,6 +8813,7 @@ bool upb_FileDef_HasOptions(const upb_FileDef* f);
8777
8813
  const char* upb_FileDef_Name(const upb_FileDef* f);
8778
8814
  const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f);
8779
8815
  const char* upb_FileDef_Package(const upb_FileDef* f);
8816
+ const char* upb_FileDef_Edition(const upb_FileDef* f);
8780
8817
  const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
8781
8818
 
8782
8819
  const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
@@ -9889,7 +9926,7 @@ size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
9889
9926
  upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s);
9890
9927
 
9891
9928
  bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext,
9892
- upb_FieldDef* f);
9929
+ const upb_FieldDef* f);
9893
9930
  bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v,
9894
9931
  upb_Status* status);
9895
9932
  bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size,
@@ -10015,23 +10052,6 @@ UPB_INLINE upb_FileDef* _upb_DefBuilder_File(const upb_DefBuilder* ctx) {
10015
10052
  void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name,
10016
10053
  bool full);
10017
10054
 
10018
- // Verify a relative identifier string. The loop is branchless for speed.
10019
- UPB_INLINE void _upb_DefBuilder_CheckIdentNotFull(upb_DefBuilder* ctx,
10020
- upb_StringView name) {
10021
- bool good = name.size > 0;
10022
-
10023
- for (size_t i = 0; i < name.size; i++) {
10024
- const char c = name.data[i];
10025
- const char d = c | 0x20; // force lowercase
10026
- const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_');
10027
- const bool is_numer = ('0' <= c) & (c <= '9') & (i != 0);
10028
-
10029
- good &= is_alpha | is_numer;
10030
- }
10031
-
10032
- if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, false);
10033
- }
10034
-
10035
10055
  // Verify a full identifier string. This is slightly more complicated than
10036
10056
  // verifying a relative identifier string because we must track '.' chars.
10037
10057
  UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx,
@@ -10135,6 +10155,14 @@ int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
10135
10155
  uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f);
10136
10156
  void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix,
10137
10157
  upb_FieldDef* f);
10158
+ void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
10159
+ const upb_FieldDef* f);
10160
+
10161
+ // Allocate and initialize an array of |n| extensions (field defs).
10162
+ upb_FieldDef* _upb_Extensions_New(
10163
+ upb_DefBuilder* ctx, int n,
10164
+ const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix,
10165
+ upb_MessageDef* m);
10138
10166
 
10139
10167
  // Allocate and initialize an array of |n| field defs.
10140
10168
  upb_FieldDef* _upb_FieldDefs_New(
@@ -10199,6 +10227,7 @@ bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size,
10199
10227
  void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m,
10200
10228
  const upb_FieldDef* f);
10201
10229
  bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n);
10230
+ void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m);
10202
10231
  void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx,
10203
10232
  const upb_MessageDef* m);
10204
10233
  void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.22.0.rc.2
4
+ version: 3.22.0.rc.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-02 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -107,7 +107,7 @@ homepage: https://developers.google.com/protocol-buffers
107
107
  licenses:
108
108
  - BSD-3-Clause
109
109
  metadata:
110
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.22.0-rc2/ruby
110
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.22.0-rc3/ruby
111
111
  post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths: