google-protobuf 4.35.0.rc.1-x86_64-linux-gnu → 4.35.0.rc.2-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c1b29f7f306c8fc5c0e0027b580b2b978a03b73a1347630936d123e435aea93
4
- data.tar.gz: 483e3f98e2dc45ed5b8d0d83b32c0873025d758f2ea5231d8ddfa91a981b78fd
3
+ metadata.gz: 042a79f42cd6679c55d958bcdd75758ca89532cfe242918259ee2bf55f9f8268
4
+ data.tar.gz: 6503bd5c5d3e1b9b45ffa35760ecbac01377af499cd02379ecc0340fe239a397
5
5
  SHA512:
6
- metadata.gz: b77db69da0906b2004830900902258d5751275c86cda2d1177d0b17a7ed27912d07968bd3856db523c417c22d2a93c9834cf3764d16d7b63ff8330ccc603d54a
7
- data.tar.gz: 9225e74085ab3d63cd8bc6134e811c22dcdec01091ec470040e70716a212b1a1e8d35db4dc3761e6d6fd3eb3070d4d065befa222c6fdcc29729fe73404578fb7
6
+ metadata.gz: 8ce738e5ebfa8b8382caed6153e5c165808068bb4e26065b29cff0fce794b47d5a319a4988307ff728acdd501f4759c4f9eccc830522ea2dfe0fb373b71ef4a0
7
+ data.tar.gz: 3deb43a6d45e77710bf6a0ec6f2f68f0c41c3c8993bfc2b381892f69fd214357813be9598370b1aa6f2bd705c4904192e67a87f36ab8903233bfeb0d6a62c21d
@@ -558,7 +558,15 @@ Error, UINTPTR_MAX is undefined
558
558
  // }
559
559
  // }
560
560
 
561
+ #if defined(__GNUC__) && !defined(__clang__)
562
+ // GCC can't handle mismatched retain attributes in the same section:
563
+ // https://github.com/protocolbuffers/protobuf/issues/26385
564
+ // To work around this, we retain all linker array elements, even though this
565
+ // effectively disables tree-shaking of unused extensions when using GCC.
566
+ #define UPB_LINKARR_ATTR UPB_RETAIN
567
+ #else
561
568
  #define UPB_LINKARR_ATTR
569
+ #endif
562
570
 
563
571
  #define UPB_LINKARR_SENTINEL UPB_RETAIN __attribute__((weak, used))
564
572
 
@@ -2980,6 +2988,8 @@ const uint32_t* upb_exttable_remove(upb_exttable* t, const void* k,
2980
2988
  return NULL;
2981
2989
  }
2982
2990
 
2991
+ size_t upb_exttable_size(const upb_exttable* t) { return t->t.count; }
2992
+
2983
2993
  /* upb_inttable ***************************************************************/
2984
2994
 
2985
2995
  /* For inttables we use a hybrid structure where small keys are kept in an
@@ -10370,7 +10380,12 @@ const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
10370
10380
  return (const upb_MiniTableExtension*)v;
10371
10381
  }
10372
10382
 
10383
+ size_t upb_ExtensionRegistry_Size(const upb_ExtensionRegistry* r) {
10384
+ return upb_exttable_size(&r->exts);
10385
+ }
10386
+
10373
10387
 
10388
+ #include <stddef.h>
10374
10389
  #include <stdint.h>
10375
10390
 
10376
10391
 
@@ -10398,21 +10413,17 @@ static bool _upb_GeneratedRegistry_AddAllLinkedExtensions(
10398
10413
  const UPB_PRIVATE(upb_GeneratedExtensionListEntry)* entry =
10399
10414
  UPB_PRIVATE(upb_generated_extension_list);
10400
10415
  while (entry != NULL) {
10401
- // Comparing pointers to different objects is undefined behavior, so we
10402
- // convert them to uintptr_t and compare their values.
10403
- uintptr_t begin = (uintptr_t)entry->start;
10404
- uintptr_t end = (uintptr_t)entry->stop;
10405
- uintptr_t current = begin;
10406
- while (current < end) {
10407
- const upb_MiniTableExtension* ext =
10408
- (const upb_MiniTableExtension*)current;
10416
+ const upb_MiniTableExtension** current = entry->start;
10417
+ for (current = entry->start; current != entry->stop; ++current) {
10418
+ const upb_MiniTableExtension* ext = *current;
10409
10419
  // Sentinels and padding introduced by the linker can result in zeroed
10410
10420
  // entries, so simply skip them.
10411
- if (upb_MiniTableExtension_Number(ext) == 0) {
10421
+ if (*current == NULL) {
10412
10422
  // MSVC introduces padding that might not be sized exactly the same as
10413
- // upb_MiniTableExtension, so we can't iterate by sizeof. This is a
10414
- // valid thing for any linker to do, so it's safer to just always do it.
10415
- current += UPB_ALIGN_OF(upb_MiniTableExtension);
10423
+ // the linker array element, but it should be properly aligned, so just
10424
+ // skipping empty elements should be safe. (If the size and align of
10425
+ // the array elements was different, we'd have to do something more
10426
+ // complicated).
10416
10427
  continue;
10417
10428
  }
10418
10429
 
@@ -10420,7 +10431,6 @@ static bool _upb_GeneratedRegistry_AddAllLinkedExtensions(
10420
10431
  kUpb_ExtensionRegistryStatus_Ok) {
10421
10432
  return false;
10422
10433
  }
10423
- current += sizeof(upb_MiniTableExtension);
10424
10434
  }
10425
10435
  entry = entry->next;
10426
10436
  }
@@ -557,7 +557,15 @@ Error, UINTPTR_MAX is undefined
557
557
  // }
558
558
  // }
559
559
 
560
+ #if defined(__GNUC__) && !defined(__clang__)
561
+ // GCC can't handle mismatched retain attributes in the same section:
562
+ // https://github.com/protocolbuffers/protobuf/issues/26385
563
+ // To work around this, we retain all linker array elements, even though this
564
+ // effectively disables tree-shaking of unused extensions when using GCC.
565
+ #define UPB_LINKARR_ATTR UPB_RETAIN
566
+ #else
560
567
  #define UPB_LINKARR_ATTR
568
+ #endif
561
569
 
562
570
  #define UPB_LINKARR_SENTINEL UPB_RETAIN __attribute__((weak, used))
563
571
 
@@ -5806,6 +5814,9 @@ upb_ExtensionRegistryStatus upb_ExtensionRegistry_AddArray(
5806
5814
  UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
5807
5815
  const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
5808
5816
 
5817
+ // Returns the number of extensions in the registry. For testing/debugging only.
5818
+ UPB_API size_t upb_ExtensionRegistry_Size(const upb_ExtensionRegistry* r);
5819
+
5809
5820
  #ifdef __cplusplus
5810
5821
  } /* extern "C" */
5811
5822
  #endif
@@ -5916,8 +5927,8 @@ extern "C" {
5916
5927
  #endif
5917
5928
 
5918
5929
  typedef struct UPB_PRIVATE(upb_GeneratedExtensionListEntry) {
5919
- const struct upb_MiniTableExtension* start;
5920
- const struct upb_MiniTableExtension* stop;
5930
+ const struct upb_MiniTableExtension** start;
5931
+ const struct upb_MiniTableExtension** stop;
5921
5932
  const struct UPB_PRIVATE(upb_GeneratedExtensionListEntry) * next;
5922
5933
  } UPB_PRIVATE(upb_GeneratedExtensionListEntry);
5923
5934
 
@@ -6317,6 +6328,8 @@ const uint32_t* upb_exttable_lookup(const upb_exttable* t, const void* k,
6317
6328
  const uint32_t* upb_exttable_remove(upb_exttable* t, const void* k,
6318
6329
  uint32_t ext_number);
6319
6330
 
6331
+ size_t upb_exttable_size(const upb_exttable* t);
6332
+
6320
6333
  #ifdef __cplusplus
6321
6334
  } /* extern "C" */
6322
6335
  #endif
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.35.0.rc.1
4
+ version: 4.35.0.rc.2
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-20 00:00:00.000000000 Z
10
+ date: 2026-05-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal
@@ -185,7 +185,7 @@ homepage: https://developers.google.com/protocol-buffers
185
185
  licenses:
186
186
  - BSD-3-Clause
187
187
  metadata:
188
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.35.0-rc1/ruby
188
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.35.0-rc2/ruby
189
189
  rdoc_options: []
190
190
  require_paths:
191
191
  - lib