Clarify that `upb_Message_SetString` does not copy data.

PiperOrigin-RevId: 613258771
pull/16080/head
Éamonn McManus 9 months ago committed by Copybara-Service
parent fac929d9aa
commit 6cbcff4bb6
  1. 4
      upb/message/accessors.h

@ -295,6 +295,10 @@ upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
return upb_Message_GetField(msg, field, def).str_val; return upb_Message_GetField(msg, field, def).str_val;
} }
// Sets the value of a `string` or `bytes` field. The bytes of the value are not
// copied, so it is the caller's responsibility to ensure that they remain valid
// for the lifetime of `msg`. That might be done by copying them into the given
// arena, or by fusing that arena with the arena the bytes live in, for example.
UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
const upb_MiniTableField* field, const upb_MiniTableField* field,
upb_StringView value, upb_Arena* a) { upb_StringView value, upb_Arena* a) {

Loading…
Cancel
Save