Auto-generate files after cl/708077050

pull/19755/head
Protobuf Team Bot 4 months ago
parent 47f5b75659
commit e890d15663
  1. 17
      php/ext/google/protobuf/php-upb.c
  2. 7
      php/ext/google/protobuf/php-upb.h
  3. 17
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 7
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -3962,11 +3962,18 @@ bool UPB_PRIVATE(_upb_Message_AddUnknown)(upb_Message* msg, const char* data,
if (!UPB_PRIVATE(_upb_Message_ReserveSlot)(msg, arena)) {
return false;
}
upb_StringView* view = upb_Arena_Malloc(arena, sizeof(upb_StringView) + len);
if (!view) return false;
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
memcpy(copy, data, len);
view->data = copy;
upb_StringView* view;
if (alias) {
view = upb_Arena_Malloc(arena, sizeof(upb_StringView));
if (!view) return false;
view->data = data;
} else {
view = upb_Arena_Malloc(arena, sizeof(upb_StringView) + len);
if (!view) return false;
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
memcpy(copy, data, len);
view->data = copy;
}
view->size = len;
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
in->aux_data[in->size++] = upb_TaggedAuxPtr_MakeUnknownData(view);

@ -3125,7 +3125,8 @@ void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
// Adds unknown data (serialized protobuf data) to the given message. The data
// must represent one or more complete and well formed proto fields.
// The data is copied into the message instance.
// If alias is set, will keep a view to the provided data; otherwise a copy is
// made.
bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
const char* data, size_t len,
upb_Arena* arena, bool alias);
@ -5439,8 +5440,8 @@ extern "C" {
#endif
enum {
/* If set, strings will alias the input buffer instead of copying into the
* arena. */
/* If set, strings and unknown fields will alias the input buffer instead of
* copying into the arena. */
kUpb_DecodeOption_AliasString = 1,
/* If set, the parse will return failure if any message is missing any

@ -3962,11 +3962,18 @@ bool UPB_PRIVATE(_upb_Message_AddUnknown)(upb_Message* msg, const char* data,
if (!UPB_PRIVATE(_upb_Message_ReserveSlot)(msg, arena)) {
return false;
}
upb_StringView* view = upb_Arena_Malloc(arena, sizeof(upb_StringView) + len);
if (!view) return false;
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
memcpy(copy, data, len);
view->data = copy;
upb_StringView* view;
if (alias) {
view = upb_Arena_Malloc(arena, sizeof(upb_StringView));
if (!view) return false;
view->data = data;
} else {
view = upb_Arena_Malloc(arena, sizeof(upb_StringView) + len);
if (!view) return false;
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
memcpy(copy, data, len);
view->data = copy;
}
view->size = len;
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
in->aux_data[in->size++] = upb_TaggedAuxPtr_MakeUnknownData(view);

@ -3127,7 +3127,8 @@ void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
// Adds unknown data (serialized protobuf data) to the given message. The data
// must represent one or more complete and well formed proto fields.
// The data is copied into the message instance.
// If alias is set, will keep a view to the provided data; otherwise a copy is
// made.
bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
const char* data, size_t len,
upb_Arena* arena, bool alias);
@ -5441,8 +5442,8 @@ extern "C" {
#endif
enum {
/* If set, strings will alias the input buffer instead of copying into the
* arena. */
/* If set, strings and unknown fields will alias the input buffer instead of
* copying into the arena. */
kUpb_DecodeOption_AliasString = 1,
/* If set, the parse will return failure if any message is missing any

Loading…
Cancel
Save