ソースを参照

Addressed code-review comment.

Chris Fallin 10 年 前
コミット
315b93fdcc
1 ファイル変更4 行追加0 行削除
  1. 4 0
      ruby/ext/google/protobuf_c/encode_decode.c

+ 4 - 0
ruby/ext/google/protobuf_c/encode_decode.c

@@ -208,6 +208,10 @@ typedef struct {
   size_t ofs;
   upb_fieldtype_t key_field_type;
   upb_fieldtype_t value_field_type;
+
+  // We know that we can hold this reference because the handlerdata has the
+  // same lifetime as the upb_handlers struct, and the upb_handlers struct holds
+  // a reference to the upb_msgdef, which in turn has references to its subdefs.
   const upb_def* value_field_subdef;
 } map_handlerdata_t;