aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/protobuf.h
diff options
context:
space:
mode:
authorChris Fallin <cfallin@c1f.net>2015-01-09 15:29:45 -0800
committerChris Fallin <cfallin@c1f.net>2015-01-09 15:37:55 -0800
commit4c92289766d76f276b322ab254ef039f670f41b1 (patch)
tree92d8ad529bc1d27139134befb506dfd5905a1dbf /ruby/ext/google/protobuf_c/protobuf.h
parent80276ac0218f6d8fcdbad0fb09b233b31d2bc0fb (diff)
downloadprotobuf-4c92289766d76f276b322ab254ef039f670f41b1.tar.gz
protobuf-4c92289766d76f276b322ab254ef039f670f41b1.tar.bz2
protobuf-4c92289766d76f276b322ab254ef039f670f41b1.zip
Addressed code-review comments.
Diffstat (limited to 'ruby/ext/google/protobuf_c/protobuf.h')
-rw-r--r--ruby/ext/google/protobuf_c/protobuf.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ruby/ext/google/protobuf_c/protobuf.h b/ruby/ext/google/protobuf_c/protobuf.h
index 6dac6029..88ae62e4 100644
--- a/ruby/ext/google/protobuf_c/protobuf.h
+++ b/ruby/ext/google/protobuf_c/protobuf.h
@@ -110,6 +110,10 @@ struct Descriptor {
const upb_pbdecodermethod* fill_method;
const upb_handlers* pb_serialize_handlers;
const upb_handlers* json_serialize_handlers;
+ // Handlers hold type class references for sub-message fields directly in some
+ // cases. We need to keep these rooted because they might otherwise be
+ // collected.
+ VALUE typeclass_references;
};
struct FieldDescriptor {
@@ -252,7 +256,7 @@ void native_slot_set(upb_fieldtype_t type,
VALUE value);
VALUE native_slot_get(upb_fieldtype_t type,
VALUE type_class,
- void* memory);
+ const void* memory);
void native_slot_init(upb_fieldtype_t type, void* memory);
void native_slot_mark(upb_fieldtype_t type, void* memory);
void native_slot_dup(upb_fieldtype_t type, void* to, void* from);
@@ -389,7 +393,7 @@ struct MessageLayout {
MessageLayout* create_layout(const upb_msgdef* msgdef);
void free_layout(MessageLayout* layout);
VALUE layout_get(MessageLayout* layout,
- void* storage,
+ const void* storage,
const upb_fielddef* field);
void layout_set(MessageLayout* layout,
void* storage,