Auto-generate files after cl/697036283

pull/19288/head
Protobuf Team Bot 4 months ago
parent f1d81a0d38
commit 9146075269
  1. 17
      csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs
  2. 12
      php/ext/google/protobuf/php-upb.c
  3. 10
      php/ext/google/protobuf/php-upb.h
  4. 12
      ruby/ext/google/protobuf_c/ruby-upb.c
  5. 10
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -0,0 +1,17 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#endregion
namespace Google.Protobuf.Reflection;
internal sealed partial class FeatureSetDescriptor
{
// Canonical serialized form of the edition defaults, generated by embed_edition_defaults.
private const string DefaultsBase64 =
"ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH";
}

@ -60,6 +60,15 @@ Error, UINTPTR_MAX is undefined
*/
#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
// A flexible array member may have lower alignment requirements than the struct
// overall - in that case, it can overlap with the trailing padding of the rest
// of the struct, and a naive sizeof(base) + sizeof(flex) * count calculation
// will not take into account that overlap, and allocate more than is required.
#define UPB_SIZEOF_FLEX(type, member, count) \
(UPB_MAX(sizeof(type), \
(offsetof(type, member) + \
count * (offsetof(type, member[1]) - offsetof(type, member[0])))))
#define UPB_MAPTYPE_STRING 0
// UPB_EXPORT: always generate a public symbol.
@ -4935,7 +4944,7 @@ typedef struct {
} upb_MdEnumDecoder;
static size_t upb_MiniTableEnum_Size(size_t count) {
return sizeof(upb_MiniTableEnum) + count * sizeof(uint32_t);
return UPB_SIZEOF_FLEX(upb_MiniTableEnum, UPB_PRIVATE(data), count);
}
static upb_MiniTableEnum* _upb_MiniTable_AddEnumDataMember(upb_MdEnumDecoder* d,
@ -17297,6 +17306,7 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_SIZEOF_FLEX
#undef UPB_MAPTYPE_STRING
#undef UPB_EXPORT
#undef UPB_INLINE

@ -59,6 +59,15 @@ Error, UINTPTR_MAX is undefined
*/
#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
// A flexible array member may have lower alignment requirements than the struct
// overall - in that case, it can overlap with the trailing padding of the rest
// of the struct, and a naive sizeof(base) + sizeof(flex) * count calculation
// will not take into account that overlap, and allocate more than is required.
#define UPB_SIZEOF_FLEX(type, member, count) \
(UPB_MAX(sizeof(type), \
(offsetof(type, member) + \
count * (offsetof(type, member[1]) - offsetof(type, member[0])))))
#define UPB_MAPTYPE_STRING 0
// UPB_EXPORT: always generate a public symbol.
@ -15528,6 +15537,7 @@ upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_SIZEOF_FLEX
#undef UPB_MAPTYPE_STRING
#undef UPB_EXPORT
#undef UPB_INLINE

@ -60,6 +60,15 @@ Error, UINTPTR_MAX is undefined
*/
#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
// A flexible array member may have lower alignment requirements than the struct
// overall - in that case, it can overlap with the trailing padding of the rest
// of the struct, and a naive sizeof(base) + sizeof(flex) * count calculation
// will not take into account that overlap, and allocate more than is required.
#define UPB_SIZEOF_FLEX(type, member, count) \
(UPB_MAX(sizeof(type), \
(offsetof(type, member) + \
count * (offsetof(type, member[1]) - offsetof(type, member[0])))))
#define UPB_MAPTYPE_STRING 0
// UPB_EXPORT: always generate a public symbol.
@ -4935,7 +4944,7 @@ typedef struct {
} upb_MdEnumDecoder;
static size_t upb_MiniTableEnum_Size(size_t count) {
return sizeof(upb_MiniTableEnum) + count * sizeof(uint32_t);
return UPB_SIZEOF_FLEX(upb_MiniTableEnum, UPB_PRIVATE(data), count);
}
static upb_MiniTableEnum* _upb_MiniTable_AddEnumDataMember(upb_MdEnumDecoder* d,
@ -16784,6 +16793,7 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_SIZEOF_FLEX
#undef UPB_MAPTYPE_STRING
#undef UPB_EXPORT
#undef UPB_INLINE

@ -61,6 +61,15 @@ Error, UINTPTR_MAX is undefined
*/
#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
// A flexible array member may have lower alignment requirements than the struct
// overall - in that case, it can overlap with the trailing padding of the rest
// of the struct, and a naive sizeof(base) + sizeof(flex) * count calculation
// will not take into account that overlap, and allocate more than is required.
#define UPB_SIZEOF_FLEX(type, member, count) \
(UPB_MAX(sizeof(type), \
(offsetof(type, member) + \
count * (offsetof(type, member[1]) - offsetof(type, member[0])))))
#define UPB_MAPTYPE_STRING 0
// UPB_EXPORT: always generate a public symbol.
@ -15341,6 +15350,7 @@ upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_SIZEOF_FLEX
#undef UPB_MAPTYPE_STRING
#undef UPB_EXPORT
#undef UPB_INLINE

Loading…
Cancel
Save