google-protobuf 3.21.12-x86-linux → 3.22.0.rc.3-x86-linux

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of google-protobuf might be problematic. Click here for more details.

Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/ext/google/protobuf_c/convert.c +0 -0
  3. data/ext/google/protobuf_c/convert.h +0 -0
  4. data/ext/google/protobuf_c/defs.c +3 -3
  5. data/ext/google/protobuf_c/defs.h +0 -0
  6. data/ext/google/protobuf_c/extconf.rb +2 -3
  7. data/ext/google/protobuf_c/map.c +27 -42
  8. data/ext/google/protobuf_c/map.h +0 -0
  9. data/ext/google/protobuf_c/message.c +116 -99
  10. data/ext/google/protobuf_c/message.h +0 -0
  11. data/ext/google/protobuf_c/protobuf.c +0 -0
  12. data/ext/google/protobuf_c/protobuf.h +0 -0
  13. data/ext/google/protobuf_c/repeated_field.c +0 -0
  14. data/ext/google/protobuf_c/repeated_field.h +0 -0
  15. data/ext/google/protobuf_c/ruby-upb.c +10546 -9149
  16. data/ext/google/protobuf_c/ruby-upb.h +7608 -3276
  17. data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +1 -0
  18. data/ext/google/protobuf_c/third_party/utf8_range/naive.c +0 -0
  19. data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +1 -1
  20. data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +0 -0
  21. data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +13 -1
  22. data/ext/google/protobuf_c/wrap_memcpy.c +0 -0
  23. data/lib/google/2.6/protobuf_c.so +0 -0
  24. data/lib/google/2.7/protobuf_c.so +0 -0
  25. data/lib/google/3.0/protobuf_c.so +0 -0
  26. data/lib/google/3.1/protobuf_c.so +0 -0
  27. data/lib/google/3.2/protobuf_c.so +0 -0
  28. data/lib/google/protobuf/any_pb.rb +0 -0
  29. data/lib/google/protobuf/api_pb.rb +0 -0
  30. data/lib/google/protobuf/descriptor_dsl.rb +0 -0
  31. data/lib/google/protobuf/descriptor_pb.rb +41 -12
  32. data/lib/google/protobuf/duration_pb.rb +0 -0
  33. data/lib/google/protobuf/empty_pb.rb +0 -0
  34. data/lib/google/protobuf/field_mask_pb.rb +0 -0
  35. data/lib/google/protobuf/message_exts.rb +5 -0
  36. data/lib/google/protobuf/plugin_pb.rb +50 -0
  37. data/lib/google/protobuf/repeated_field.rb +0 -0
  38. data/lib/google/protobuf/source_context_pb.rb +0 -0
  39. data/lib/google/protobuf/struct_pb.rb +0 -0
  40. data/lib/google/protobuf/timestamp_pb.rb +0 -0
  41. data/lib/google/protobuf/type_pb.rb +0 -0
  42. data/lib/google/protobuf/wrappers_pb.rb +0 -0
  43. data/lib/google/protobuf.rb +0 -0
  44. metadata +14 -19
  45. data/lib/google/2.5/protobuf_c.so +0 -0
  46. data/tests/basic.rb +0 -739
  47. data/tests/generated_code_test.rb +0 -23
  48. data/tests/stress.rb +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0fb609ea8572ecc89d0e2712f87adb8f4414c8eb9483a72d3707e1f7a878ff0
4
- data.tar.gz: a589992d1e99605ce603e5748426a807cad4cbb78e81e89cc18e9653b7f52194
3
+ metadata.gz: 7d4c0099e58a238d396a41615f57933acc4606bc68e235c4abaef458ace280ca
4
+ data.tar.gz: 58042d82e1c82d5d2874534192ffd2773fcdcb34c05815df60cae887efa23d7c
5
5
  SHA512:
6
- metadata.gz: 86052d74448576e42463df91b5e7caa74b4044aef923c50802fe3c1a302510cf5e2b44788040bfa2baacb715d22cc955afef8375b9ae91fcfff217c5cb89776c
7
- data.tar.gz: 5cedba38852c4dc9c258e4f0c4cef974d8830b3d2444e7e697afae72fdc51adb90e1da39fddb3f1254ed5efbd1b2b9eebb119aaefd6c51b558f06d25cfaeb4bc
6
+ metadata.gz: 34ffaa35d847264a7702bd58c01dd8ce6b5b3bb46737d6a787209b98a09f68a152da492431510526009ce95dfec99f93585c432d3163c45caedfc4582b543118
7
+ data.tar.gz: 2f26ea3bb7749607d4a150c45dd70449f20db52ef8716faf32e999edd6163cb3603c3b2b9f3b55d8fa2f378f453bed12e080fab030010a2f517c8608e57dcd28
File without changes
File without changes
@@ -811,7 +811,7 @@ static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
811
811
  rb_raise(rb_eArgError, "does not track presence");
812
812
  }
813
813
 
814
- return upb_Message_Has(msg, self->fielddef) ? Qtrue : Qfalse;
814
+ return upb_Message_HasFieldByDef(msg, self->fielddef) ? Qtrue : Qfalse;
815
815
  }
816
816
 
817
817
  /*
@@ -829,7 +829,7 @@ static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
829
829
  rb_raise(cTypeError, "has method called on wrong message type");
830
830
  }
831
831
 
832
- upb_Message_ClearField(msg, self->fielddef);
832
+ upb_Message_ClearFieldByDef(msg, self->fielddef);
833
833
  return Qnil;
834
834
  }
835
835
 
@@ -854,7 +854,7 @@ static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
854
854
 
855
855
  msgval = Convert_RubyToUpb(value, upb_FieldDef_Name(self->fielddef),
856
856
  TypeInfo_get(self->fielddef), arena);
857
- upb_Message_Set(msg, self->fielddef, msgval, arena);
857
+ upb_Message_SetFieldByDef(msg, self->fielddef, msgval, arena);
858
858
  return Qnil;
859
859
  }
860
860
 
File without changes
@@ -6,20 +6,19 @@ ext_name = "google/protobuf_c"
6
6
 
7
7
  dir_config(ext_name)
8
8
 
9
- if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
9
+ if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ || RUBY_PLATFORM =~ /freebsd/
10
10
  $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
11
11
  else
12
12
  $CFLAGS += " -std=gnu99 -O3 -DNDEBUG"
13
13
  end
14
14
 
15
-
16
15
  if RUBY_PLATFORM =~ /linux/
17
16
  # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
18
17
  $LDFLAGS += " -Wl,-wrap,memcpy"
19
18
  end
20
19
 
21
20
  $VPATH << "$(srcdir)/third_party/utf8_range"
22
- $INCFLAGS << "$(srcdir)/third_party/utf8_range"
21
+ $INCFLAGS += " -I$(srcdir)/third_party/utf8_range"
23
22
 
24
23
  $srcs = ["protobuf.c", "convert.c", "defs.c", "message.c",
25
24
  "repeated_field.c", "map.c", "ruby-upb.c", "wrap_memcpy.c",
@@ -133,14 +133,13 @@ static upb_Map* Map_GetMutable(VALUE _self) {
133
133
  VALUE Map_CreateHash(const upb_Map* map, upb_CType key_type,
134
134
  TypeInfo val_info) {
135
135
  VALUE hash = rb_hash_new();
136
- size_t iter = kUpb_Map_Begin;
137
136
  TypeInfo key_info = TypeInfo_from_type(key_type);
138
137
 
139
138
  if (!map) return hash;
140
139
 
141
- while (upb_MapIterator_Next(map, &iter)) {
142
- upb_MessageValue key = upb_MapIterator_Key(map, iter);
143
- upb_MessageValue val = upb_MapIterator_Value(map, iter);
140
+ size_t iter = kUpb_Map_Begin;
141
+ upb_MessageValue key, val;
142
+ while (upb_Map_Next(map, &key, &val, &iter)) {
144
143
  VALUE key_val = Convert_UpbToRuby(key, key_info, Qnil);
145
144
  VALUE val_val = Scalar_CreateHash(val, val_info);
146
145
  rb_hash_aset(hash, key_val, val_val);
@@ -156,9 +155,8 @@ VALUE Map_deep_copy(VALUE obj) {
156
155
  upb_Map* new_map =
157
156
  upb_Map_New(arena, self->key_type, self->value_type_info.type);
158
157
  size_t iter = kUpb_Map_Begin;
159
- while (upb_MapIterator_Next(self->map, &iter)) {
160
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
161
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
158
+ upb_MessageValue key, val;
159
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
162
160
  upb_MessageValue val_copy =
163
161
  Msgval_DeepCopy(val, self->value_type_info, arena);
164
162
  upb_Map_Set(new_map, key, val_copy, arena);
@@ -202,9 +200,8 @@ void Map_Inspect(StringBuilder* b, const upb_Map* map, upb_CType key_type,
202
200
  StringBuilder_Printf(b, "{");
203
201
  if (map) {
204
202
  size_t iter = kUpb_Map_Begin;
205
- while (upb_MapIterator_Next(map, &iter)) {
206
- upb_MessageValue key = upb_MapIterator_Key(map, iter);
207
- upb_MessageValue val = upb_MapIterator_Value(map, iter);
203
+ upb_MessageValue key, val;
204
+ while (upb_Map_Next(map, &key, &val, &iter)) {
208
205
  if (first) {
209
206
  first = false;
210
207
  } else {
@@ -239,7 +236,6 @@ static VALUE Map_merge_into_self(VALUE _self, VALUE hashmap) {
239
236
  Map* other = ruby_to_Map(hashmap);
240
237
  upb_Arena* arena = Arena_get(self->arena);
241
238
  upb_Message* self_msg = Map_GetMutable(_self);
242
- size_t iter = kUpb_Map_Begin;
243
239
 
244
240
  Arena_fuse(other->arena, arena);
245
241
 
@@ -249,9 +245,9 @@ static VALUE Map_merge_into_self(VALUE _self, VALUE hashmap) {
249
245
  rb_raise(rb_eArgError, "Attempt to merge Map with mismatching types");
250
246
  }
251
247
 
252
- while (upb_MapIterator_Next(other->map, &iter)) {
253
- upb_MessageValue key = upb_MapIterator_Key(other->map, iter);
254
- upb_MessageValue val = upb_MapIterator_Value(other->map, iter);
248
+ size_t iter = kUpb_Map_Begin;
249
+ upb_MessageValue key, val;
250
+ while (upb_Map_Next(other->map, &key, &val, &iter)) {
255
251
  upb_Map_Set(self_msg, key, val, arena);
256
252
  }
257
253
  } else {
@@ -343,10 +339,9 @@ static VALUE Map_init(int argc, VALUE* argv, VALUE _self) {
343
339
  static VALUE Map_each(VALUE _self) {
344
340
  Map* self = ruby_to_Map(_self);
345
341
  size_t iter = kUpb_Map_Begin;
342
+ upb_MessageValue key, val;
346
343
 
347
- while (upb_MapIterator_Next(self->map, &iter)) {
348
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
349
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
344
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
350
345
  VALUE key_val = Convert_UpbToRuby(key, Map_keyinfo(self), self->arena);
351
346
  VALUE val_val = Convert_UpbToRuby(val, self->value_type_info, self->arena);
352
347
  rb_yield_values(2, key_val, val_val);
@@ -365,9 +360,9 @@ static VALUE Map_keys(VALUE _self) {
365
360
  Map* self = ruby_to_Map(_self);
366
361
  size_t iter = kUpb_Map_Begin;
367
362
  VALUE ret = rb_ary_new();
363
+ upb_MessageValue key, val;
368
364
 
369
- while (upb_MapIterator_Next(self->map, &iter)) {
370
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
365
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
371
366
  VALUE key_val = Convert_UpbToRuby(key, Map_keyinfo(self), self->arena);
372
367
  rb_ary_push(ret, key_val);
373
368
  }
@@ -385,9 +380,9 @@ static VALUE Map_values(VALUE _self) {
385
380
  Map* self = ruby_to_Map(_self);
386
381
  size_t iter = kUpb_Map_Begin;
387
382
  VALUE ret = rb_ary_new();
383
+ upb_MessageValue key, val;
388
384
 
389
- while (upb_MapIterator_Next(self->map, &iter)) {
390
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
385
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
391
386
  VALUE val_val = Convert_UpbToRuby(val, self->value_type_info, self->arena);
392
387
  rb_ary_push(ret, val_val);
393
388
  }
@@ -464,24 +459,17 @@ static VALUE Map_has_key(VALUE _self, VALUE key) {
464
459
  */
465
460
  static VALUE Map_delete(VALUE _self, VALUE key) {
466
461
  Map* self = ruby_to_Map(_self);
462
+ rb_check_frozen(_self);
463
+
467
464
  upb_MessageValue key_upb =
468
465
  Convert_RubyToUpb(key, "", Map_keyinfo(self), NULL);
469
466
  upb_MessageValue val_upb;
470
- VALUE ret;
471
467
 
472
- rb_check_frozen(_self);
473
-
474
- // TODO(haberman): make upb_Map_Delete() also capable of returning the deleted
475
- // value.
476
- if (upb_Map_Get(self->map, key_upb, &val_upb)) {
477
- ret = Convert_UpbToRuby(val_upb, self->value_type_info, self->arena);
468
+ if (upb_Map_Delete(self->map, key_upb, &val_upb)) {
469
+ return Convert_UpbToRuby(val_upb, self->value_type_info, self->arena);
478
470
  } else {
479
- ret = Qnil;
471
+ return Qnil;
480
472
  }
481
-
482
- upb_Map_Delete(Map_GetMutable(_self), key_upb);
483
-
484
- return ret;
485
473
  }
486
474
 
487
475
  /*
@@ -523,9 +511,8 @@ static VALUE Map_dup(VALUE _self) {
523
511
 
524
512
  Arena_fuse(self->arena, arena);
525
513
 
526
- while (upb_MapIterator_Next(self->map, &iter)) {
527
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
528
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
514
+ upb_MessageValue key, val;
515
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
529
516
  upb_Map_Set(new_map, key, val, arena);
530
517
  }
531
518
 
@@ -574,9 +561,8 @@ VALUE Map_eq(VALUE _self, VALUE _other) {
574
561
  // For each member of self, check that an equal member exists at the same key
575
562
  // in other.
576
563
  size_t iter = kUpb_Map_Begin;
577
- while (upb_MapIterator_Next(self->map, &iter)) {
578
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
579
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
564
+ upb_MessageValue key, val;
565
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
580
566
  upb_MessageValue other_val;
581
567
  if (!upb_Map_Get(other->map, key, &other_val)) {
582
568
  // Not present in other map.
@@ -619,9 +605,8 @@ VALUE Map_hash(VALUE _self) {
619
605
 
620
606
  size_t iter = kUpb_Map_Begin;
621
607
  TypeInfo key_info = {self->key_type};
622
- while (upb_MapIterator_Next(self->map, &iter)) {
623
- upb_MessageValue key = upb_MapIterator_Key(self->map, iter);
624
- upb_MessageValue val = upb_MapIterator_Value(self->map, iter);
608
+ upb_MessageValue key, val;
609
+ while (upb_Map_Next(self->map, &key, &val, &iter)) {
625
610
  hash = Msgval_GetHash(key, key_info, hash);
626
611
  hash = Msgval_GetHash(val, self->value_type_info, hash);
627
612
  }
File without changes