|
|
@ -1012,7 +1012,6 @@ static VALUE Message_decode_json(int argc, VALUE* argv, VALUE klass) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static VALUE Message_encode(VALUE klass, VALUE msg_rb) { |
|
|
|
static VALUE Message_encode(VALUE klass, VALUE msg_rb) { |
|
|
|
Message* msg = ruby_to_Message(msg_rb); |
|
|
|
Message* msg = ruby_to_Message(msg_rb); |
|
|
|
upb_arena *arena = upb_arena_new(); |
|
|
|
|
|
|
|
const char *data; |
|
|
|
const char *data; |
|
|
|
size_t size; |
|
|
|
size_t size; |
|
|
|
|
|
|
|
|
|
|
@ -1020,6 +1019,8 @@ static VALUE Message_encode(VALUE klass, VALUE msg_rb) { |
|
|
|
rb_raise(rb_eArgError, "Message of wrong type."); |
|
|
|
rb_raise(rb_eArgError, "Message of wrong type."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
upb_arena *arena = upb_arena_new(); |
|
|
|
|
|
|
|
|
|
|
|
data = upb_encode(msg->msg, upb_msgdef_layout(msg->msgdef), arena, |
|
|
|
data = upb_encode(msg->msg, upb_msgdef_layout(msg->msgdef), arena, |
|
|
|
&size); |
|
|
|
&size); |
|
|
|
|
|
|
|
|
|
|
|