google-protobuf 3.22.5-x86-mingw32 → 3.23.0.rc.1-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/defs.c +22 -12
- data/ext/google/protobuf_c/message.c +13 -5
- data/ext/google/protobuf_c/protobuf.c +4 -2
- data/ext/google/protobuf_c/ruby-upb.c +656 -608
- data/ext/google/protobuf_c/ruby-upb.h +1361 -254
- 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 +24 -5
- data/lib/google/protobuf/api_pb.rb +26 -23
- data/lib/google/protobuf/descriptor_pb.rb +29 -252
- data/lib/google/protobuf/duration_pb.rb +24 -5
- data/lib/google/protobuf/empty_pb.rb +24 -3
- data/lib/google/protobuf/field_mask_pb.rb +24 -4
- data/lib/google/protobuf/plugin_pb.rb +25 -28
- data/lib/google/protobuf/source_context_pb.rb +24 -4
- data/lib/google/protobuf/struct_pb.rb +24 -20
- data/lib/google/protobuf/timestamp_pb.rb +24 -5
- data/lib/google/protobuf/type_pb.rb +26 -68
- data/lib/google/protobuf/wrappers_pb.rb +24 -28
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b8baa8fddf3ef688bc88bc152f13257b093a4e381beb247a95066148600bef
|
4
|
+
data.tar.gz: 91b1cf264d5ec8cc58ad593dd9450a7df6b9bac1a24a8d9db60766b6743ea8c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240052d1582dcb991290ae45810c199d4c60afad15b689dc5ec39672bd81d8ea4a11dca541e37e97a5a7c9a0d514d85e894394b72c26e52a22d35b0869b4c40c
|
7
|
+
data.tar.gz: 2a1112e31aaffb307f0fcadfe25a0c41c3673b51ab179e80f9db63f986ac79b9845c37b2ae25c80de1a0ba2b7563b78597ef9ec1fd7aeee55c3d243a018473fc
|
@@ -223,6 +223,8 @@ static void DescriptorPool_register(VALUE module) {
|
|
223
223
|
|
224
224
|
typedef struct {
|
225
225
|
const upb_MessageDef* msgdef;
|
226
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
227
|
+
// macro to update VALUE references, as to trigger write barriers.
|
226
228
|
VALUE klass;
|
227
229
|
VALUE descriptor_pool;
|
228
230
|
} Descriptor;
|
@@ -238,7 +240,7 @@ static void Descriptor_mark(void* _self) {
|
|
238
240
|
static const rb_data_type_t Descriptor_type = {
|
239
241
|
"Google::Protobuf::Descriptor",
|
240
242
|
{Descriptor_mark, RUBY_DEFAULT_FREE, NULL},
|
241
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
243
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
242
244
|
};
|
243
245
|
|
244
246
|
static Descriptor* ruby_to_Descriptor(VALUE val) {
|
@@ -280,7 +282,7 @@ static VALUE Descriptor_initialize(VALUE _self, VALUE cookie,
|
|
280
282
|
"Descriptor objects may not be created from Ruby.");
|
281
283
|
}
|
282
284
|
|
283
|
-
self->descriptor_pool
|
285
|
+
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
|
284
286
|
self->msgdef = (const upb_MessageDef*)NUM2ULL(ptr);
|
285
287
|
|
286
288
|
return Qnil;
|
@@ -390,7 +392,7 @@ static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
|
|
390
392
|
static VALUE Descriptor_msgclass(VALUE _self) {
|
391
393
|
Descriptor* self = ruby_to_Descriptor(_self);
|
392
394
|
if (self->klass == Qnil) {
|
393
|
-
self->klass
|
395
|
+
RB_OBJ_WRITE(_self, &self->klass, build_class_from_descriptor(_self));
|
394
396
|
}
|
395
397
|
return self->klass;
|
396
398
|
}
|
@@ -417,6 +419,8 @@ static void Descriptor_register(VALUE module) {
|
|
417
419
|
|
418
420
|
typedef struct {
|
419
421
|
const upb_FileDef* filedef;
|
422
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
423
|
+
// macro to update VALUE references, as to trigger write barriers.
|
420
424
|
VALUE descriptor_pool; // Owns the upb_FileDef.
|
421
425
|
} FileDescriptor;
|
422
426
|
|
@@ -430,7 +434,7 @@ static void FileDescriptor_mark(void* _self) {
|
|
430
434
|
static const rb_data_type_t FileDescriptor_type = {
|
431
435
|
"Google::Protobuf::FileDescriptor",
|
432
436
|
{FileDescriptor_mark, RUBY_DEFAULT_FREE, NULL},
|
433
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
437
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
434
438
|
};
|
435
439
|
|
436
440
|
static FileDescriptor* ruby_to_FileDescriptor(VALUE val) {
|
@@ -463,7 +467,7 @@ static VALUE FileDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
463
467
|
"Descriptor objects may not be created from Ruby.");
|
464
468
|
}
|
465
469
|
|
466
|
-
self->descriptor_pool
|
470
|
+
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
|
467
471
|
self->filedef = (const upb_FileDef*)NUM2ULL(ptr);
|
468
472
|
|
469
473
|
return Qnil;
|
@@ -519,6 +523,8 @@ static void FileDescriptor_register(VALUE module) {
|
|
519
523
|
|
520
524
|
typedef struct {
|
521
525
|
const upb_FieldDef* fielddef;
|
526
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
527
|
+
// macro to update VALUE references, as to trigger write barriers.
|
522
528
|
VALUE descriptor_pool; // Owns the upb_FieldDef.
|
523
529
|
} FieldDescriptor;
|
524
530
|
|
@@ -532,7 +538,7 @@ static void FieldDescriptor_mark(void* _self) {
|
|
532
538
|
static const rb_data_type_t FieldDescriptor_type = {
|
533
539
|
"Google::Protobuf::FieldDescriptor",
|
534
540
|
{FieldDescriptor_mark, RUBY_DEFAULT_FREE, NULL},
|
535
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
541
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
536
542
|
};
|
537
543
|
|
538
544
|
static FieldDescriptor* ruby_to_FieldDescriptor(VALUE val) {
|
@@ -570,7 +576,7 @@ static VALUE FieldDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
570
576
|
"Descriptor objects may not be created from Ruby.");
|
571
577
|
}
|
572
578
|
|
573
|
-
self->descriptor_pool
|
579
|
+
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
|
574
580
|
self->fielddef = (const upb_FieldDef*)NUM2ULL(ptr);
|
575
581
|
|
576
582
|
return Qnil;
|
@@ -884,6 +890,8 @@ static void FieldDescriptor_register(VALUE module) {
|
|
884
890
|
|
885
891
|
typedef struct {
|
886
892
|
const upb_OneofDef* oneofdef;
|
893
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
894
|
+
// macro to update VALUE references, as to trigger write barriers.
|
887
895
|
VALUE descriptor_pool; // Owns the upb_OneofDef.
|
888
896
|
} OneofDescriptor;
|
889
897
|
|
@@ -897,7 +905,7 @@ static void OneofDescriptor_mark(void* _self) {
|
|
897
905
|
static const rb_data_type_t OneofDescriptor_type = {
|
898
906
|
"Google::Protobuf::OneofDescriptor",
|
899
907
|
{OneofDescriptor_mark, RUBY_DEFAULT_FREE, NULL},
|
900
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
908
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
901
909
|
};
|
902
910
|
|
903
911
|
static OneofDescriptor* ruby_to_OneofDescriptor(VALUE val) {
|
@@ -936,7 +944,7 @@ static VALUE OneofDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
936
944
|
"Descriptor objects may not be created from Ruby.");
|
937
945
|
}
|
938
946
|
|
939
|
-
self->descriptor_pool
|
947
|
+
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
|
940
948
|
self->oneofdef = (const upb_OneofDef*)NUM2ULL(ptr);
|
941
949
|
|
942
950
|
return Qnil;
|
@@ -988,6 +996,8 @@ static void OneofDescriptor_register(VALUE module) {
|
|
988
996
|
|
989
997
|
typedef struct {
|
990
998
|
const upb_EnumDef* enumdef;
|
999
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
1000
|
+
// macro to update VALUE references, as to trigger write barriers.
|
991
1001
|
VALUE module; // begins as nil
|
992
1002
|
VALUE descriptor_pool; // Owns the upb_EnumDef.
|
993
1003
|
} EnumDescriptor;
|
@@ -1003,7 +1013,7 @@ static void EnumDescriptor_mark(void* _self) {
|
|
1003
1013
|
static const rb_data_type_t EnumDescriptor_type = {
|
1004
1014
|
"Google::Protobuf::EnumDescriptor",
|
1005
1015
|
{EnumDescriptor_mark, RUBY_DEFAULT_FREE, NULL},
|
1006
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
1016
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
1007
1017
|
};
|
1008
1018
|
|
1009
1019
|
static EnumDescriptor* ruby_to_EnumDescriptor(VALUE val) {
|
@@ -1042,7 +1052,7 @@ static VALUE EnumDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
1042
1052
|
"Descriptor objects may not be created from Ruby.");
|
1043
1053
|
}
|
1044
1054
|
|
1045
|
-
self->descriptor_pool
|
1055
|
+
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
|
1046
1056
|
self->enumdef = (const upb_EnumDef*)NUM2ULL(ptr);
|
1047
1057
|
|
1048
1058
|
return Qnil;
|
@@ -1138,7 +1148,7 @@ static VALUE EnumDescriptor_each(VALUE _self) {
|
|
1138
1148
|
static VALUE EnumDescriptor_enummodule(VALUE _self) {
|
1139
1149
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
1140
1150
|
if (self->module == Qnil) {
|
1141
|
-
self->module
|
1151
|
+
RB_OBJ_WRITE(_self, &self->module, build_module_from_enumdesc(_self));
|
1142
1152
|
}
|
1143
1153
|
return self->module;
|
1144
1154
|
}
|
@@ -53,6 +53,8 @@ VALUE MessageOrEnum_GetDescriptor(VALUE klass) {
|
|
53
53
|
// -----------------------------------------------------------------------------
|
54
54
|
|
55
55
|
typedef struct {
|
56
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
57
|
+
// macro to update VALUE references, as to trigger write barriers.
|
56
58
|
VALUE arena;
|
57
59
|
const upb_Message* msg; // Can get as mutable when non-frozen.
|
58
60
|
const upb_MessageDef*
|
@@ -65,9 +67,9 @@ static void Message_mark(void* _self) {
|
|
65
67
|
}
|
66
68
|
|
67
69
|
static rb_data_type_t Message_type = {
|
68
|
-
"Message",
|
70
|
+
"Google::Protobuf::Message",
|
69
71
|
{Message_mark, RUBY_DEFAULT_FREE, NULL},
|
70
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
72
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
71
73
|
};
|
72
74
|
|
73
75
|
static Message* ruby_to_Message(VALUE msg_rb) {
|
@@ -105,7 +107,7 @@ upb_Message* Message_GetMutable(VALUE msg_rb, const upb_MessageDef** m) {
|
|
105
107
|
void Message_InitPtr(VALUE self_, upb_Message* msg, VALUE arena) {
|
106
108
|
Message* self = ruby_to_Message(self_);
|
107
109
|
self->msg = msg;
|
108
|
-
self->arena
|
110
|
+
RB_OBJ_WRITE(self_, &self->arena, arena);
|
109
111
|
ObjectCache_Add(msg, self_);
|
110
112
|
}
|
111
113
|
|
@@ -978,7 +980,7 @@ static VALUE Message_decode(int argc, VALUE* argv, VALUE klass) {
|
|
978
980
|
rb_hash_lookup(hash_args, ID2SYM(rb_intern("recursion_limit")));
|
979
981
|
|
980
982
|
if (depth != Qnil && TYPE(depth) == T_FIXNUM) {
|
981
|
-
options |=
|
983
|
+
options |= upb_DecodeOptions_MaxDepth(FIX2INT(depth));
|
982
984
|
}
|
983
985
|
}
|
984
986
|
|
@@ -1096,7 +1098,7 @@ static VALUE Message_encode(int argc, VALUE* argv, VALUE klass) {
|
|
1096
1098
|
rb_hash_lookup(hash_args, ID2SYM(rb_intern("recursion_limit")));
|
1097
1099
|
|
1098
1100
|
if (depth != Qnil && TYPE(depth) == T_FIXNUM) {
|
1099
|
-
options |=
|
1101
|
+
options |= upb_DecodeOptions_MaxDepth(FIX2INT(depth));
|
1100
1102
|
}
|
1101
1103
|
}
|
1102
1104
|
|
@@ -1162,6 +1164,12 @@ static VALUE Message_encode_json(int argc, VALUE* argv, VALUE klass) {
|
|
1162
1164
|
Qfalse))) {
|
1163
1165
|
options |= upb_JsonEncode_EmitDefaults;
|
1164
1166
|
}
|
1167
|
+
|
1168
|
+
if (RTEST(rb_hash_lookup2(hash_args,
|
1169
|
+
ID2SYM(rb_intern("format_enums_as_integers")),
|
1170
|
+
Qfalse))) {
|
1171
|
+
options |= upb_JsonEncode_FormatEnumsAsIntegers;
|
1172
|
+
}
|
1165
1173
|
}
|
1166
1174
|
|
1167
1175
|
upb_Status_Clear(&status);
|
@@ -171,6 +171,8 @@ void StringBuilder_PrintMsgval(StringBuilder *b, upb_MessageValue val,
|
|
171
171
|
|
172
172
|
typedef struct {
|
173
173
|
upb_Arena *arena;
|
174
|
+
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
|
175
|
+
// macro to update VALUE references, as to trigger write barriers.
|
174
176
|
VALUE pinned_objs;
|
175
177
|
} Arena;
|
176
178
|
|
@@ -190,7 +192,7 @@ static VALUE cArena;
|
|
190
192
|
const rb_data_type_t Arena_type = {
|
191
193
|
"Google::Protobuf::Internal::Arena",
|
192
194
|
{Arena_mark, Arena_free, NULL},
|
193
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
195
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
|
194
196
|
};
|
195
197
|
|
196
198
|
static void* ruby_upb_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, size_t size) {
|
@@ -233,7 +235,7 @@ void Arena_Pin(VALUE _arena, VALUE obj) {
|
|
233
235
|
Arena *arena;
|
234
236
|
TypedData_Get_Struct(_arena, Arena, &Arena_type, arena);
|
235
237
|
if (arena->pinned_objs == Qnil) {
|
236
|
-
arena->pinned_objs
|
238
|
+
RB_OBJ_WRITE(_arena, &arena->pinned_objs, rb_ary_new());
|
237
239
|
}
|
238
240
|
rb_ary_push(arena->pinned_objs, obj);
|
239
241
|
}
|