google-protobuf 3.19.6-x64-mingw32 → 3.20.0.rc.1-x64-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 +124 -111
- data/ext/google/protobuf_c/convert.h +12 -9
- data/ext/google/protobuf_c/defs.c +196 -201
- data/ext/google/protobuf_c/defs.h +19 -19
- data/ext/google/protobuf_c/extconf.rb +11 -3
- data/ext/google/protobuf_c/map.c +109 -101
- data/ext/google/protobuf_c/map.h +7 -8
- data/ext/google/protobuf_c/message.c +382 -303
- data/ext/google/protobuf_c/message.h +22 -19
- data/ext/google/protobuf_c/protobuf.c +57 -58
- data/ext/google/protobuf_c/protobuf.h +13 -10
- data/ext/google/protobuf_c/repeated_field.c +82 -84
- data/ext/google/protobuf_c/repeated_field.h +6 -6
- data/ext/google/protobuf_c/ruby-upb.c +4945 -3084
- data/ext/google/protobuf_c/ruby-upb.h +2285 -1701
- data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +21 -0
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.c +395 -0
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +9 -0
- data/ext/google/protobuf_c/wrap_memcpy.c +4 -3
- data/lib/google/2.5/protobuf_c.so +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/protobuf/descriptor_dsl.rb +8 -1
- data/lib/google/protobuf/descriptor_pb.rb +3 -2
- data/lib/google/protobuf/message_exts.rb +2 -2
- data/lib/google/protobuf/well_known_types.rb +11 -6
- data/lib/google/protobuf.rb +4 -4
- data/tests/basic.rb +14 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 689f21c96a87f151f843b042c0db37283207fdd4d0a6f356f1bf796177b49020
|
4
|
+
data.tar.gz: 8e6ad5cfe94b2c89178a548532f46389f3b6198512ab20493b35570739acc0de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d9da89a599abb37e667f0132d0b769194dbd4712e1678910aa0acc459e7ace75601e0723798184d91f737f3f63315dc2096141e015edc4746069eff0134b36
|
7
|
+
data.tar.gz: edf95d043ddaff794f1bff2c97eb7f0ad8124a9f456084d097963915524c38c39f5e1d3ce4a4be7e1bdd3b6d9fa72a5b00cac51c12f3b87d928d8e257b47683f
|
@@ -31,7 +31,7 @@
|
|
31
31
|
// -----------------------------------------------------------------------------
|
32
32
|
// Ruby <-> upb data conversion functions.
|
33
33
|
//
|
34
|
-
// This file Also contains a few other assorted algorithms on
|
34
|
+
// This file Also contains a few other assorted algorithms on upb_MessageValue.
|
35
35
|
//
|
36
36
|
// None of the algorithms in this file require any access to the internal
|
37
37
|
// representation of Ruby or upb objects.
|
@@ -42,10 +42,10 @@
|
|
42
42
|
#include "message.h"
|
43
43
|
#include "protobuf.h"
|
44
44
|
|
45
|
-
static
|
46
|
-
|
45
|
+
static upb_StringView Convert_StringData(VALUE str, upb_Arena* arena) {
|
46
|
+
upb_StringView ret;
|
47
47
|
if (arena) {
|
48
|
-
char
|
48
|
+
char* ptr = upb_Arena_Malloc(arena, RSTRING_LEN(str));
|
49
49
|
memcpy(ptr, RSTRING_PTR(str), RSTRING_LEN(str));
|
50
50
|
ret.data = ptr;
|
51
51
|
} else {
|
@@ -57,13 +57,11 @@ static upb_strview Convert_StringData(VALUE str, upb_arena *arena) {
|
|
57
57
|
}
|
58
58
|
|
59
59
|
static bool is_ruby_num(VALUE value) {
|
60
|
-
return (TYPE(value) == T_FLOAT ||
|
61
|
-
TYPE(value) == T_FIXNUM ||
|
60
|
+
return (TYPE(value) == T_FLOAT || TYPE(value) == T_FIXNUM ||
|
62
61
|
TYPE(value) == T_BIGNUM);
|
63
62
|
}
|
64
63
|
|
65
|
-
static void Convert_CheckInt(const char* name,
|
66
|
-
VALUE val) {
|
64
|
+
static void Convert_CheckInt(const char* name, upb_CType type, VALUE val) {
|
67
65
|
if (!is_ruby_num(val)) {
|
68
66
|
rb_raise(cTypeError,
|
69
67
|
"Expected number type for integral field '%s' (given %s).", name,
|
@@ -82,7 +80,7 @@ static void Convert_CheckInt(const char* name, upb_fieldtype_t type,
|
|
82
80
|
name, rb_class2name(CLASS_OF(val)));
|
83
81
|
}
|
84
82
|
}
|
85
|
-
if (type ==
|
83
|
+
if (type == kUpb_CType_UInt32 || type == kUpb_CType_UInt64) {
|
86
84
|
if (NUM2DBL(val) < 0) {
|
87
85
|
rb_raise(
|
88
86
|
rb_eRangeError,
|
@@ -93,26 +91,31 @@ static void Convert_CheckInt(const char* name, upb_fieldtype_t type,
|
|
93
91
|
}
|
94
92
|
|
95
93
|
static int32_t Convert_ToEnum(VALUE value, const char* name,
|
96
|
-
const
|
94
|
+
const upb_EnumDef* e) {
|
97
95
|
int32_t val;
|
98
96
|
|
99
97
|
switch (TYPE(value)) {
|
100
98
|
case T_FLOAT:
|
101
99
|
case T_FIXNUM:
|
102
100
|
case T_BIGNUM:
|
103
|
-
Convert_CheckInt(name,
|
101
|
+
Convert_CheckInt(name, kUpb_CType_Int32, value);
|
104
102
|
val = NUM2INT(value);
|
105
103
|
break;
|
106
|
-
case T_STRING:
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
case T_STRING: {
|
105
|
+
const upb_EnumValueDef* ev = upb_EnumDef_FindValueByNameWithSize(
|
106
|
+
e, RSTRING_PTR(value), RSTRING_LEN(value));
|
107
|
+
if (!ev) goto unknownval;
|
108
|
+
val = upb_EnumValueDef_Number(ev);
|
110
109
|
break;
|
111
|
-
|
112
|
-
|
110
|
+
}
|
111
|
+
case T_SYMBOL: {
|
112
|
+
const upb_EnumValueDef* ev =
|
113
|
+
upb_EnumDef_FindValueByName(e, rb_id2name(SYM2ID(value)));
|
114
|
+
if (!ev)
|
113
115
|
goto unknownval;
|
114
|
-
|
116
|
+
val = upb_EnumValueDef_Number(ev);
|
115
117
|
break;
|
118
|
+
}
|
116
119
|
default:
|
117
120
|
rb_raise(cTypeError,
|
118
121
|
"Expected number or symbol type for enum field '%s'.", name);
|
@@ -124,47 +127,52 @@ unknownval:
|
|
124
127
|
rb_raise(rb_eRangeError, "Unknown symbol value for enum field '%s'.", name);
|
125
128
|
}
|
126
129
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
+
upb_MessageValue Convert_RubyToUpb(VALUE value, const char* name,
|
131
|
+
TypeInfo type_info, upb_Arena* arena) {
|
132
|
+
upb_MessageValue ret;
|
130
133
|
|
131
134
|
switch (type_info.type) {
|
132
|
-
case
|
135
|
+
case kUpb_CType_Float:
|
133
136
|
if (!is_ruby_num(value)) {
|
134
|
-
rb_raise(cTypeError,
|
135
|
-
|
137
|
+
rb_raise(cTypeError,
|
138
|
+
"Expected number type for float field '%s' (given %s).", name,
|
139
|
+
rb_class2name(CLASS_OF(value)));
|
136
140
|
}
|
137
141
|
ret.float_val = NUM2DBL(value);
|
138
142
|
break;
|
139
|
-
case
|
143
|
+
case kUpb_CType_Double:
|
140
144
|
if (!is_ruby_num(value)) {
|
141
|
-
rb_raise(cTypeError,
|
142
|
-
|
145
|
+
rb_raise(cTypeError,
|
146
|
+
"Expected number type for double field '%s' (given %s).", name,
|
147
|
+
rb_class2name(CLASS_OF(value)));
|
143
148
|
}
|
144
149
|
ret.double_val = NUM2DBL(value);
|
145
150
|
break;
|
146
|
-
case
|
151
|
+
case kUpb_CType_Bool: {
|
147
152
|
if (value == Qtrue) {
|
148
153
|
ret.bool_val = 1;
|
149
154
|
} else if (value == Qfalse) {
|
150
155
|
ret.bool_val = 0;
|
151
156
|
} else {
|
152
|
-
rb_raise(cTypeError,
|
153
|
-
|
157
|
+
rb_raise(cTypeError,
|
158
|
+
"Invalid argument for boolean field '%s' (given %s).", name,
|
159
|
+
rb_class2name(CLASS_OF(value)));
|
154
160
|
}
|
155
161
|
break;
|
156
162
|
}
|
157
|
-
case
|
163
|
+
case kUpb_CType_String: {
|
158
164
|
VALUE utf8 = rb_enc_from_encoding(rb_utf8_encoding());
|
159
|
-
if (
|
165
|
+
if (rb_obj_class(value) == rb_cSymbol) {
|
160
166
|
value = rb_funcall(value, rb_intern("to_s"), 0);
|
161
|
-
} else if (
|
162
|
-
rb_raise(cTypeError,
|
163
|
-
|
167
|
+
} else if (rb_obj_class(value) != rb_cString) {
|
168
|
+
rb_raise(cTypeError,
|
169
|
+
"Invalid argument for string field '%s' (given %s).", name,
|
170
|
+
rb_class2name(CLASS_OF(value)));
|
164
171
|
}
|
165
172
|
|
166
173
|
if (rb_obj_encoding(value) != utf8) {
|
167
|
-
// Note: this will not duplicate underlying string data unless
|
174
|
+
// Note: this will not duplicate underlying string data unless
|
175
|
+
// necessary.
|
168
176
|
value = rb_str_encode(value, utf8, 0, Qnil);
|
169
177
|
|
170
178
|
if (rb_enc_str_coderange(value) == ENC_CODERANGE_BROKEN) {
|
@@ -175,15 +183,17 @@ upb_msgval Convert_RubyToUpb(VALUE value, const char* name, TypeInfo type_info,
|
|
175
183
|
ret.str_val = Convert_StringData(value, arena);
|
176
184
|
break;
|
177
185
|
}
|
178
|
-
case
|
186
|
+
case kUpb_CType_Bytes: {
|
179
187
|
VALUE bytes = rb_enc_from_encoding(rb_ascii8bit_encoding());
|
180
|
-
if (
|
181
|
-
rb_raise(cTypeError,
|
182
|
-
|
188
|
+
if (rb_obj_class(value) != rb_cString) {
|
189
|
+
rb_raise(cTypeError,
|
190
|
+
"Invalid argument for bytes field '%s' (given %s).", name,
|
191
|
+
rb_class2name(CLASS_OF(value)));
|
183
192
|
}
|
184
193
|
|
185
194
|
if (rb_obj_encoding(value) != bytes) {
|
186
|
-
// Note: this will not duplicate underlying string data unless
|
195
|
+
// Note: this will not duplicate underlying string data unless
|
196
|
+
// necessary.
|
187
197
|
// TODO(haberman): is this really necessary to get raw bytes?
|
188
198
|
value = rb_str_encode(value, bytes, 0, Qnil);
|
189
199
|
}
|
@@ -191,33 +201,33 @@ upb_msgval Convert_RubyToUpb(VALUE value, const char* name, TypeInfo type_info,
|
|
191
201
|
ret.str_val = Convert_StringData(value, arena);
|
192
202
|
break;
|
193
203
|
}
|
194
|
-
case
|
204
|
+
case kUpb_CType_Message:
|
195
205
|
ret.msg_val =
|
196
206
|
Message_GetUpbMessage(value, type_info.def.msgdef, name, arena);
|
197
207
|
break;
|
198
|
-
case
|
208
|
+
case kUpb_CType_Enum:
|
199
209
|
ret.int32_val = Convert_ToEnum(value, name, type_info.def.enumdef);
|
200
210
|
break;
|
201
|
-
case
|
202
|
-
case
|
203
|
-
case
|
204
|
-
case
|
211
|
+
case kUpb_CType_Int32:
|
212
|
+
case kUpb_CType_Int64:
|
213
|
+
case kUpb_CType_UInt32:
|
214
|
+
case kUpb_CType_UInt64:
|
205
215
|
Convert_CheckInt(name, type_info.type, value);
|
206
216
|
switch (type_info.type) {
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
217
|
+
case kUpb_CType_Int32:
|
218
|
+
ret.int32_val = NUM2INT(value);
|
219
|
+
break;
|
220
|
+
case kUpb_CType_Int64:
|
221
|
+
ret.int64_val = NUM2LL(value);
|
222
|
+
break;
|
223
|
+
case kUpb_CType_UInt32:
|
224
|
+
ret.uint32_val = NUM2UINT(value);
|
225
|
+
break;
|
226
|
+
case kUpb_CType_UInt64:
|
227
|
+
ret.uint64_val = NUM2ULL(value);
|
228
|
+
break;
|
229
|
+
default:
|
230
|
+
break;
|
221
231
|
}
|
222
232
|
break;
|
223
233
|
default:
|
@@ -227,45 +237,46 @@ upb_msgval Convert_RubyToUpb(VALUE value, const char* name, TypeInfo type_info,
|
|
227
237
|
return ret;
|
228
238
|
}
|
229
239
|
|
230
|
-
VALUE Convert_UpbToRuby(
|
240
|
+
VALUE Convert_UpbToRuby(upb_MessageValue upb_val, TypeInfo type_info,
|
241
|
+
VALUE arena) {
|
231
242
|
switch (type_info.type) {
|
232
|
-
case
|
243
|
+
case kUpb_CType_Float:
|
233
244
|
return DBL2NUM(upb_val.float_val);
|
234
|
-
case
|
245
|
+
case kUpb_CType_Double:
|
235
246
|
return DBL2NUM(upb_val.double_val);
|
236
|
-
case
|
247
|
+
case kUpb_CType_Bool:
|
237
248
|
return upb_val.bool_val ? Qtrue : Qfalse;
|
238
|
-
case
|
249
|
+
case kUpb_CType_Int32:
|
239
250
|
return INT2NUM(upb_val.int32_val);
|
240
|
-
case
|
251
|
+
case kUpb_CType_Int64:
|
241
252
|
return LL2NUM(upb_val.int64_val);
|
242
|
-
case
|
253
|
+
case kUpb_CType_UInt32:
|
243
254
|
return UINT2NUM(upb_val.uint32_val);
|
244
|
-
case
|
255
|
+
case kUpb_CType_UInt64:
|
245
256
|
return ULL2NUM(upb_val.int64_val);
|
246
|
-
case
|
247
|
-
const
|
248
|
-
|
249
|
-
if (
|
250
|
-
return ID2SYM(rb_intern(
|
257
|
+
case kUpb_CType_Enum: {
|
258
|
+
const upb_EnumValueDef *ev = upb_EnumDef_FindValueByNumber(
|
259
|
+
type_info.def.enumdef, upb_val.int32_val);
|
260
|
+
if (ev) {
|
261
|
+
return ID2SYM(rb_intern(upb_EnumValueDef_Name(ev)));
|
251
262
|
} else {
|
252
263
|
return INT2NUM(upb_val.int32_val);
|
253
264
|
}
|
254
265
|
}
|
255
|
-
case
|
266
|
+
case kUpb_CType_String: {
|
256
267
|
VALUE str_rb = rb_str_new(upb_val.str_val.data, upb_val.str_val.size);
|
257
268
|
rb_enc_associate(str_rb, rb_utf8_encoding());
|
258
269
|
rb_obj_freeze(str_rb);
|
259
270
|
return str_rb;
|
260
271
|
}
|
261
|
-
case
|
272
|
+
case kUpb_CType_Bytes: {
|
262
273
|
VALUE str_rb = rb_str_new(upb_val.str_val.data, upb_val.str_val.size);
|
263
274
|
rb_enc_associate(str_rb, rb_ascii8bit_encoding());
|
264
275
|
rb_obj_freeze(str_rb);
|
265
276
|
return str_rb;
|
266
277
|
}
|
267
|
-
case
|
268
|
-
return Message_GetRubyWrapper((
|
278
|
+
case kUpb_CType_Message:
|
279
|
+
return Message_GetRubyWrapper((upb_Message*)upb_val.msg_val,
|
269
280
|
type_info.def.msgdef, arena);
|
270
281
|
default:
|
271
282
|
rb_raise(rb_eRuntimeError, "Convert_UpbToRuby(): Unexpected type %d",
|
@@ -273,24 +284,24 @@ VALUE Convert_UpbToRuby(upb_msgval upb_val, TypeInfo type_info, VALUE arena) {
|
|
273
284
|
}
|
274
285
|
}
|
275
286
|
|
276
|
-
|
277
|
-
|
278
|
-
|
287
|
+
upb_MessageValue Msgval_DeepCopy(upb_MessageValue msgval, TypeInfo type_info,
|
288
|
+
upb_Arena* arena) {
|
289
|
+
upb_MessageValue new_msgval;
|
279
290
|
|
280
291
|
switch (type_info.type) {
|
281
292
|
default:
|
282
293
|
memcpy(&new_msgval, &msgval, sizeof(msgval));
|
283
294
|
break;
|
284
|
-
case
|
285
|
-
case
|
295
|
+
case kUpb_CType_String:
|
296
|
+
case kUpb_CType_Bytes: {
|
286
297
|
size_t n = msgval.str_val.size;
|
287
|
-
char
|
298
|
+
char* mem = upb_Arena_Malloc(arena, n);
|
288
299
|
new_msgval.str_val.data = mem;
|
289
300
|
new_msgval.str_val.size = n;
|
290
301
|
memcpy(mem, msgval.str_val.data, n);
|
291
302
|
break;
|
292
303
|
}
|
293
|
-
case
|
304
|
+
case kUpb_CType_Message:
|
294
305
|
new_msgval.msg_val =
|
295
306
|
Message_deep_copy(msgval.msg_val, type_info.def.msgdef, arena);
|
296
307
|
break;
|
@@ -299,48 +310,50 @@ upb_msgval Msgval_DeepCopy(upb_msgval msgval, TypeInfo type_info,
|
|
299
310
|
return new_msgval;
|
300
311
|
}
|
301
312
|
|
302
|
-
bool Msgval_IsEqual(
|
313
|
+
bool Msgval_IsEqual(upb_MessageValue val1, upb_MessageValue val2,
|
314
|
+
TypeInfo type_info) {
|
303
315
|
switch (type_info.type) {
|
304
|
-
case
|
316
|
+
case kUpb_CType_Bool:
|
305
317
|
return memcmp(&val1, &val2, 1) == 0;
|
306
|
-
case
|
307
|
-
case
|
308
|
-
case
|
309
|
-
case
|
318
|
+
case kUpb_CType_Float:
|
319
|
+
case kUpb_CType_Int32:
|
320
|
+
case kUpb_CType_UInt32:
|
321
|
+
case kUpb_CType_Enum:
|
310
322
|
return memcmp(&val1, &val2, 4) == 0;
|
311
|
-
case
|
312
|
-
case
|
313
|
-
case
|
323
|
+
case kUpb_CType_Double:
|
324
|
+
case kUpb_CType_Int64:
|
325
|
+
case kUpb_CType_UInt64:
|
314
326
|
return memcmp(&val1, &val2, 8) == 0;
|
315
|
-
case
|
316
|
-
case
|
327
|
+
case kUpb_CType_String:
|
328
|
+
case kUpb_CType_Bytes:
|
317
329
|
return val1.str_val.size == val2.str_val.size &&
|
318
|
-
memcmp(val1.str_val.data, val2.str_val.data,
|
319
|
-
|
320
|
-
case
|
330
|
+
memcmp(val1.str_val.data, val2.str_val.data, val1.str_val.size) ==
|
331
|
+
0;
|
332
|
+
case kUpb_CType_Message:
|
321
333
|
return Message_Equal(val1.msg_val, val2.msg_val, type_info.def.msgdef);
|
322
334
|
default:
|
323
335
|
rb_raise(rb_eRuntimeError, "Internal error, unexpected type");
|
324
336
|
}
|
325
337
|
}
|
326
338
|
|
327
|
-
uint64_t Msgval_GetHash(
|
339
|
+
uint64_t Msgval_GetHash(upb_MessageValue val, TypeInfo type_info,
|
340
|
+
uint64_t seed) {
|
328
341
|
switch (type_info.type) {
|
329
|
-
case
|
342
|
+
case kUpb_CType_Bool:
|
330
343
|
return Wyhash(&val, 1, seed, kWyhashSalt);
|
331
|
-
case
|
332
|
-
case
|
333
|
-
case
|
334
|
-
case
|
344
|
+
case kUpb_CType_Float:
|
345
|
+
case kUpb_CType_Int32:
|
346
|
+
case kUpb_CType_UInt32:
|
347
|
+
case kUpb_CType_Enum:
|
335
348
|
return Wyhash(&val, 4, seed, kWyhashSalt);
|
336
|
-
case
|
337
|
-
case
|
338
|
-
case
|
349
|
+
case kUpb_CType_Double:
|
350
|
+
case kUpb_CType_Int64:
|
351
|
+
case kUpb_CType_UInt64:
|
339
352
|
return Wyhash(&val, 8, seed, kWyhashSalt);
|
340
|
-
case
|
341
|
-
case
|
353
|
+
case kUpb_CType_String:
|
354
|
+
case kUpb_CType_Bytes:
|
342
355
|
return Wyhash(val.str_val.data, val.str_val.size, seed, kWyhashSalt);
|
343
|
-
case
|
356
|
+
case kUpb_CType_Message:
|
344
357
|
return Message_Hash(val.msg_val, type_info.def.msgdef, seed);
|
345
358
|
default:
|
346
359
|
rb_raise(rb_eRuntimeError, "Internal error, unexpected type");
|
@@ -36,7 +36,7 @@
|
|
36
36
|
#include "protobuf.h"
|
37
37
|
#include "ruby-upb.h"
|
38
38
|
|
39
|
-
// Converts |ruby_val| to a
|
39
|
+
// Converts |ruby_val| to a upb_MessageValue according to |type_info|.
|
40
40
|
//
|
41
41
|
// The |arena| parameter indicates the lifetime of the container where this
|
42
42
|
// value will be assigned. It is used as follows:
|
@@ -47,8 +47,8 @@
|
|
47
47
|
// - If type is message and the Ruby value is a message instance, we will fuse
|
48
48
|
// the message's arena into |arena|, to ensure that this message outlives the
|
49
49
|
// container.
|
50
|
-
|
51
|
-
|
50
|
+
upb_MessageValue Convert_RubyToUpb(VALUE ruby_val, const char *name,
|
51
|
+
TypeInfo type_info, upb_Arena *arena);
|
52
52
|
|
53
53
|
// Converts |upb_val| to a Ruby VALUE according to |type_info|. This may involve
|
54
54
|
// creating a Ruby wrapper object.
|
@@ -56,17 +56,20 @@ upb_msgval Convert_RubyToUpb(VALUE ruby_val, const char *name,
|
|
56
56
|
// The |arena| parameter indicates the arena that owns the lifetime of
|
57
57
|
// |upb_val|. Any Ruby wrapper object that is created will reference |arena|
|
58
58
|
// and ensure it outlives the wrapper.
|
59
|
-
VALUE Convert_UpbToRuby(
|
59
|
+
VALUE Convert_UpbToRuby(upb_MessageValue upb_val, TypeInfo type_info,
|
60
|
+
VALUE arena);
|
60
61
|
|
61
62
|
// Creates a deep copy of |msgval| in |arena|.
|
62
|
-
|
63
|
-
|
63
|
+
upb_MessageValue Msgval_DeepCopy(upb_MessageValue msgval, TypeInfo type_info,
|
64
|
+
upb_Arena *arena);
|
64
65
|
|
65
66
|
// Returns true if |val1| and |val2| are equal. Their type is given by
|
66
67
|
// |type_info|.
|
67
|
-
bool Msgval_IsEqual(
|
68
|
+
bool Msgval_IsEqual(upb_MessageValue val1, upb_MessageValue val2,
|
69
|
+
TypeInfo type_info);
|
68
70
|
|
69
|
-
// Returns a hash value for the given
|
70
|
-
uint64_t Msgval_GetHash(
|
71
|
+
// Returns a hash value for the given upb_MessageValue.
|
72
|
+
uint64_t Msgval_GetHash(upb_MessageValue val, TypeInfo type_info,
|
73
|
+
uint64_t seed);
|
71
74
|
|
72
75
|
#endif // RUBY_PROTOBUF_CONVERT_H_
|