diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-02-05 22:07:10 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-02-05 22:07:10 -0800 |
commit | 806ba1c80d86bd59759cf59efc057662eecbcf65 (patch) | |
tree | d30146be1313d6be6818cb1c613fc4ea26b9a7d1 /core/upb_msg.c | |
parent | 3affb319260263efc3cee502896d9f981186c7da (diff) |
Another round of fixes.
test_vs_proto2.googlemessage1 passes again,
with no memory leaks!
Diffstat (limited to 'core/upb_msg.c')
-rw-r--r-- | core/upb_msg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/upb_msg.c b/core/upb_msg.c index 1ad73bc..f628e3c 100644 --- a/core/upb_msg.c +++ b/core/upb_msg.c @@ -168,10 +168,10 @@ static void upb_msg_appendval(upb_msg *msg, upb_fielddef *f, upb_value val) { // We do: // - upb_string_recycle(), upb_string_substr() instead of // - upb_string_unref(), upb_string_getref() - // because we have a convenient place of caching these string objects for - // reuse, where as the upb_src who is sending us these strings may not. - // This saves the upb_src from allocating new upb_strings all the time to - // give us. + // because we can conveniently caching these upb_string objects in the + // upb_msg, whereas the upb_src who is sending us these strings may not + // have a good way of caching them. This saves the upb_src from allocating + // new upb_strings all the time to give us. // // If you were using this to copy one upb_msg to another this would // allocate string objects whereas a upb_string_getref could have avoided @@ -183,6 +183,7 @@ static void upb_msg_appendval(upb_msg *msg, upb_fielddef *f, upb_value val) { } else { upb_value_write(p, val, f->type); } + upb_msg_sethas(msg, f); } upb_msg *upb_msg_appendmsg(upb_msg *msg, upb_fielddef *f, upb_msgdef *msgdef) { |