Auto-generate files after cl/646470242

pull/17231/head
Protobuf Team Bot 5 months ago
parent 290df684f9
commit f4b57b98b0
  1. 30
      php/ext/google/protobuf/php-upb.c
  2. 20
      php/ext/google/protobuf/php-upb.h
  3. 30
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 20
      ruby/ext/google/protobuf_c/ruby-upb.h
  5. 3
      src/file_lists.cmake

@ -6378,6 +6378,36 @@ upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
return clone;
}
#include "stddef.h"
// Must be last.
bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg,
upb_Arena* arena) {
char* buf = NULL;
size_t size = 0;
// This tmp arena is used to hold the bytes for `src` serialized. This bends
// the typical "no hidden allocations" design of upb, but under a properly
// optimized implementation this extra allocation would not be necessary and
// so we don't want to unnecessarily have the bad API or bloat the passed-in
// arena with this very-short-term allocation.
upb_Arena* encode_arena = upb_Arena_New();
upb_EncodeStatus e_status = upb_Encode(src, mt, 0, encode_arena, &buf, &size);
if (e_status != kUpb_EncodeStatus_Ok) {
upb_Arena_Free(encode_arena);
return false;
}
upb_DecodeStatus d_status = upb_Decode(buf, size, dst, mt, extreg, 0, arena);
if (d_status != kUpb_DecodeStatus_Ok) {
upb_Arena_Free(encode_arena);
return false;
}
upb_Arena_Free(encode_arena);
return true;
}
#include <stddef.h>
#include <stdint.h>

@ -13830,6 +13830,26 @@ void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
#endif // UPB_MESSAGE_COPY_H_
#ifndef THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
#define THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
UPB_API bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg,
upb_Arena* arena);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_

@ -5866,6 +5866,36 @@ upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
return clone;
}
#include "stddef.h"
// Must be last.
bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg,
upb_Arena* arena) {
char* buf = NULL;
size_t size = 0;
// This tmp arena is used to hold the bytes for `src` serialized. This bends
// the typical "no hidden allocations" design of upb, but under a properly
// optimized implementation this extra allocation would not be necessary and
// so we don't want to unnecessarily have the bad API or bloat the passed-in
// arena with this very-short-term allocation.
upb_Arena* encode_arena = upb_Arena_New();
upb_EncodeStatus e_status = upb_Encode(src, mt, 0, encode_arena, &buf, &size);
if (e_status != kUpb_EncodeStatus_Ok) {
upb_Arena_Free(encode_arena);
return false;
}
upb_DecodeStatus d_status = upb_Decode(buf, size, dst, mt, extreg, 0, arena);
if (d_status != kUpb_DecodeStatus_Ok) {
upb_Arena_Free(encode_arena);
return false;
}
upb_Arena_Free(encode_arena);
return true;
}
#include <stddef.h>
#include <stdint.h>

@ -13596,6 +13596,26 @@ void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
#endif // UPB_MESSAGE_COPY_H_
#ifndef THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
#define THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
UPB_API bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg,
upb_Arena* arena);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_

@ -566,6 +566,7 @@ set(libupb_srcs
${protobuf_SOURCE_DIR}/upb/message/internal/message.c
${protobuf_SOURCE_DIR}/upb/message/map.c
${protobuf_SOURCE_DIR}/upb/message/map_sorter.c
${protobuf_SOURCE_DIR}/upb/message/merge.c
${protobuf_SOURCE_DIR}/upb/message/message.c
${protobuf_SOURCE_DIR}/upb/mini_descriptor/build_enum.c
${protobuf_SOURCE_DIR}/upb/mini_descriptor/decode.c
@ -642,6 +643,7 @@ set(libupb_hdrs
${protobuf_SOURCE_DIR}/upb/message/internal/types.h
${protobuf_SOURCE_DIR}/upb/message/map.h
${protobuf_SOURCE_DIR}/upb/message/map_gencode_util.h
${protobuf_SOURCE_DIR}/upb/message/merge.h
${protobuf_SOURCE_DIR}/upb/message/message.h
${protobuf_SOURCE_DIR}/upb/message/tagged_ptr.h
${protobuf_SOURCE_DIR}/upb/message/value.h
@ -978,6 +980,7 @@ set(upb_test_files
${protobuf_SOURCE_DIR}/upb/message/copy_test.cc
${protobuf_SOURCE_DIR}/upb/message/internal/compare_unknown_test.cc
${protobuf_SOURCE_DIR}/upb/message/map_test.cc
${protobuf_SOURCE_DIR}/upb/message/merge_test.cc
${protobuf_SOURCE_DIR}/upb/message/test.cc
${protobuf_SOURCE_DIR}/upb/message/utf8_test.cc
${protobuf_SOURCE_DIR}/upb/test/editions_test.cc

Loading…
Cancel
Save