google-protobuf 3.21.12-x86-mingw32 → 3.22.0.rc.3-x86-mingw32
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.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/convert.c +0 -0
- data/ext/google/protobuf_c/convert.h +0 -0
- data/ext/google/protobuf_c/defs.c +3 -3
- data/ext/google/protobuf_c/defs.h +0 -0
- data/ext/google/protobuf_c/extconf.rb +2 -3
- data/ext/google/protobuf_c/map.c +27 -42
- data/ext/google/protobuf_c/map.h +0 -0
- data/ext/google/protobuf_c/message.c +116 -99
- data/ext/google/protobuf_c/message.h +0 -0
- data/ext/google/protobuf_c/protobuf.c +0 -0
- data/ext/google/protobuf_c/protobuf.h +0 -0
- data/ext/google/protobuf_c/repeated_field.c +0 -0
- data/ext/google/protobuf_c/repeated_field.h +0 -0
- data/ext/google/protobuf_c/ruby-upb.c +10546 -9149
- data/ext/google/protobuf_c/ruby-upb.h +7608 -3276
- data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +1 -0
- data/ext/google/protobuf_c/third_party/utf8_range/naive.c +0 -0
- data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +1 -1
- data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +0 -0
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +13 -1
- data/ext/google/protobuf_c/wrap_memcpy.c +0 -0
- data/lib/google/2.6/protobuf_c.so +0 -0
- data/lib/google/2.7/protobuf_c.so +0 -0
- data/lib/google/3.0/protobuf_c.so +0 -0
- data/lib/google/3.1/protobuf_c.so +0 -0
- data/lib/google/3.2/protobuf_c.so +0 -0
- data/lib/google/protobuf/any_pb.rb +0 -0
- data/lib/google/protobuf/api_pb.rb +0 -0
- data/lib/google/protobuf/descriptor_dsl.rb +0 -0
- data/lib/google/protobuf/descriptor_pb.rb +41 -12
- data/lib/google/protobuf/duration_pb.rb +0 -0
- data/lib/google/protobuf/empty_pb.rb +0 -0
- data/lib/google/protobuf/field_mask_pb.rb +0 -0
- data/lib/google/protobuf/message_exts.rb +5 -0
- data/lib/google/protobuf/plugin_pb.rb +50 -0
- data/lib/google/protobuf/repeated_field.rb +0 -0
- data/lib/google/protobuf/source_context_pb.rb +0 -0
- data/lib/google/protobuf/struct_pb.rb +0 -0
- data/lib/google/protobuf/timestamp_pb.rb +0 -0
- data/lib/google/protobuf/type_pb.rb +0 -0
- data/lib/google/protobuf/wrappers_pb.rb +0 -0
- data/lib/google/protobuf.rb +0 -0
- metadata +14 -19
- data/lib/google/2.5/protobuf_c.so +0 -0
- data/tests/basic.rb +0 -739
- data/tests/generated_code_test.rb +0 -23
- data/tests/stress.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5bbe5ccc159d8027a03deb99ff052edd6100f5e69ab5d407094f908fba71ad
|
4
|
+
data.tar.gz: 02b2c40a6c24fe31b9c588ba669ae24d507ae164eb9936d6fdd5dff7ecf4b29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51402bd5d454fa16959656fd77bab461622b46a04d8f18ea89d9a2a17c74513ab80a264dd58adec16c7b95738f627c52561525ba9df39a7f0d5b364c5a32e3ea
|
7
|
+
data.tar.gz: 1dc729fad95f40f64937ae0ac323e9fa28d9480514f0d18d2f89c394d9bb357ec3947ecc19c21dfdf5597c85ae796dcbc54a9d8e93c467d06a09d47ab75d0dad
|
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
|
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
|
-
|
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
|
-
|
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
|
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",
|
data/ext/google/protobuf_c/map.c
CHANGED
@@ -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
|
-
|
142
|
-
|
143
|
-
|
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
|
-
|
160
|
-
|
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
|
-
|
206
|
-
|
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
|
-
|
253
|
-
|
254
|
-
|
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 (
|
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 (
|
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 (
|
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
|
-
|
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
|
-
|
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
|
-
|
527
|
-
|
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
|
-
|
578
|
-
|
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
|
-
|
623
|
-
|
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
|
}
|
data/ext/google/protobuf_c/map.h
CHANGED
File without changes
|