Auto-generate files after cl/585696951

pull/14835/head
Protobuf Team Bot 1 year ago
parent 3ce2c573b3
commit 967a351e26
  1. 49
      php/ext/google/protobuf/php-upb.c
  2. 162
      php/ext/google/protobuf/php-upb.h
  3. 49
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 162
      ruby/ext/google/protobuf_c/ruby-upb.h
  5. 80
      upb/cmake/google/protobuf/descriptor.upb.h

@ -6044,7 +6044,7 @@ upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
const upb_MiniTable* sub, upb_Arena* arena) {
size_t size = array->size;
upb_Array* cloned_array =
_upb_Array_New(arena, size, upb_CType_SizeLg2(value_type));
UPB_PRIVATE(_upb_Array_New)(arena, size, upb_CType_SizeLg2(value_type));
if (!cloned_array) {
return NULL;
}
@ -6218,7 +6218,7 @@ upb_Message* upb_Message_DeepClone(const upb_Message* message,
// Must be last.
upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
return _upb_Array_New(a, 4, upb_CType_SizeLg2(type));
return UPB_PRIVATE(_upb_Array_New)(a, 4, upb_CType_SizeLg2(type));
}
const void* upb_Array_DataPtr(const upb_Array* arr) {
@ -6232,7 +6232,7 @@ size_t upb_Array_Size(const upb_Array* arr) { return arr->size; }
upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
upb_MessageValue ret;
const char* data = _upb_array_constptr(arr);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->size);
memcpy(&ret, data + (i << lg2), 1 << lg2);
return ret;
@ -6240,7 +6240,7 @@ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) {
char* data = _upb_array_ptr(arr);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->size);
memcpy(data + (i << lg2), &val, 1 << lg2);
}
@ -6256,7 +6256,7 @@ bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) {
void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx,
size_t count) {
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
char* data = _upb_array_ptr(arr);
memmove(&data[dst_idx << lg2], &data[src_idx << lg2], count << lg2);
}
@ -6293,20 +6293,19 @@ bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) {
}
const size_t newsize = arr->size;
if (newsize > oldsize) {
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
char* data = _upb_array_ptr(arr);
memset(data + (oldsize << lg2), 0, (newsize - oldsize) << lg2);
}
return true;
}
// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
bool _upb_array_realloc(upb_Array* arr, size_t min_capacity, upb_Arena* arena) {
size_t new_capacity = UPB_MAX(arr->capacity, 4);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
size_t old_bytes = arr->capacity << lg2;
void* ptr = _upb_array_ptr(arr);
bool UPB_PRIVATE(_upb_Array_Realloc)(upb_Array* array, size_t min_capacity,
upb_Arena* arena) {
size_t new_capacity = UPB_MAX(array->UPB_PRIVATE(capacity), 4);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array);
size_t old_bytes = array->UPB_PRIVATE(capacity) << lg2;
void* ptr = _upb_array_ptr(array);
// Log2 ceiling of size.
while (new_capacity < min_capacity) new_capacity *= 2;
@ -6315,8 +6314,8 @@ bool _upb_array_realloc(upb_Array* arr, size_t min_capacity, upb_Arena* arena) {
ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes);
if (!ptr) return false;
_upb_Array_SetTaggedPtr(arr, ptr, lg2);
arr->capacity = new_capacity;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)(array, ptr, lg2);
array->UPB_PRIVATE(capacity) = new_capacity;
return true;
}
@ -12628,8 +12627,9 @@ static void _upb_Decoder_VerifyUtf8(upb_Decoder* d, const char* buf, int len) {
}
static bool _upb_Decoder_Reserve(upb_Decoder* d, upb_Array* arr, size_t elem) {
bool need_realloc = arr->capacity - arr->size < elem;
if (need_realloc && !_upb_array_realloc(arr, arr->size + elem, &d->arena)) {
bool need_realloc = arr->UPB_PRIVATE(capacity) - arr->size < elem;
if (need_realloc &&
!UPB_PRIVATE(_upb_Array_Realloc)(arr, arr->size + elem, &d->arena)) {
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
return need_realloc;
@ -12993,7 +12993,7 @@ upb_Array* _upb_Decoder_CreateArray(upb_Decoder* d,
const upb_MiniTableField* field) {
const upb_FieldType field_type = field->UPB_PRIVATE(descriptortype);
const size_t lg2 = upb_FieldType_SizeLg2(field_type);
upb_Array* ret = _upb_Array_New(&d->arena, 4, lg2);
upb_Array* ret = UPB_PRIVATE(_upb_Array_New)(&d->arena, 4, lg2);
if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
return ret;
}
@ -14017,15 +14017,15 @@ UPB_FORCEINLINE
static void* fastdecode_resizearr(upb_Decoder* d, void* dst,
fastdecode_arr* farr, int valbytes) {
if (UPB_UNLIKELY(dst == farr->end)) {
size_t old_capacity = farr->arr->capacity;
size_t old_capacity = farr->arr->UPB_PRIVATE(capacity);
size_t old_bytes = old_capacity * valbytes;
size_t new_capacity = old_capacity * 2;
size_t new_bytes = new_capacity * valbytes;
char* old_ptr = _upb_array_ptr(farr->arr);
char* new_ptr = upb_Arena_Realloc(&d->arena, old_ptr, old_bytes, new_bytes);
uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
_upb_Array_SetTaggedPtr(farr->arr, new_ptr, elem_size_lg2);
farr->arr->capacity = new_capacity;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)(farr->arr, new_ptr, elem_size_lg2);
farr->arr->UPB_PRIVATE(capacity) = new_capacity;
dst = (void*)(new_ptr + (old_capacity * valbytes));
farr->end = (void*)(new_ptr + (new_capacity * valbytes));
}
@ -14107,13 +14107,13 @@ static void* fastdecode_getfield(upb_Decoder* d, const char* ptr,
*(uint32_t*)msg |= *hasbits;
*hasbits = 0;
if (UPB_LIKELY(!*arr_p)) {
farr->arr = _upb_Array_New(&d->arena, 8, elem_size_lg2);
farr->arr = UPB_PRIVATE(_upb_Array_New)(&d->arena, 8, elem_size_lg2);
*arr_p = farr->arr;
} else {
farr->arr = *arr_p;
}
begin = _upb_array_ptr(farr->arr);
farr->end = begin + (farr->arr->capacity * valbytes);
farr->end = begin + (farr->arr->UPB_PRIVATE(capacity) * valbytes);
*data = _upb_FastDecoder_LoadTag(ptr);
return begin + (farr->arr->size * valbytes);
}
@ -14392,7 +14392,8 @@ TAGBYTES(p)
int elems = size / valbytes; \
\
if (UPB_LIKELY(!arr)) { \
*arr_p = arr = _upb_Array_New(&d->arena, elems, elem_size_lg2); \
*arr_p = arr = \
UPB_PRIVATE(_upb_Array_New)(&d->arena, elems, elem_size_lg2); \
if (!arr) { \
_upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \
} \

@ -2600,81 +2600,82 @@ struct upb_Array {
// Bit #2 contains the frozen/immutable flag (currently unimplemented).
uintptr_t data;
size_t size; // The number of elements in the array.
size_t capacity; // Allocated storage. Measured in elements.
size_t size; // The number of elements in the array.
size_t UPB_PRIVATE(capacity); // Allocated storage. Measured in elements.
};
// LINT.ThenChange(GoogleInternalName1)
UPB_INLINE void _upb_Array_SetTaggedPtr(upb_Array* arr, void* data,
size_t lg2) {
UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(upb_Array* array,
void* data, size_t lg2) {
UPB_ASSERT(lg2 != 1);
UPB_ASSERT(lg2 <= 4);
const size_t bits = lg2 - (lg2 != 0);
arr->data = (uintptr_t)data | bits;
array->data = (uintptr_t)data | bits;
}
UPB_INLINE size_t _upb_Array_ElemSizeLg2(const upb_Array* arr) {
const size_t bits = arr->data & _UPB_ARRAY_MASK_LG2;
UPB_INLINE size_t UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const upb_Array* array) {
const size_t bits = array->data & _UPB_ARRAY_MASK_LG2;
const size_t lg2 = bits + (bits != 0);
return lg2;
}
UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) {
_upb_Array_ElemSizeLg2(arr); // Check assertions.
return (void*)(arr->data & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
UPB_INLINE const void* _upb_array_constptr(const upb_Array* array) {
UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array); // Check assertions.
return (void*)(array->data & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
}
UPB_INLINE void* _upb_array_ptr(upb_Array* arr) {
return (void*)_upb_array_constptr(arr);
UPB_INLINE void* _upb_array_ptr(upb_Array* array) {
return (void*)_upb_array_constptr(array);
}
UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_capacity,
int elem_size_lg2) {
UPB_INLINE upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
size_t init_capacity,
int elem_size_lg2) {
UPB_ASSERT(elem_size_lg2 != 1);
UPB_ASSERT(elem_size_lg2 <= 4);
const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
const size_t bytes = arr_size + (init_capacity << elem_size_lg2);
upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes);
if (!arr) return NULL;
_upb_Array_SetTaggedPtr(arr, UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
arr->size = 0;
arr->capacity = init_capacity;
return arr;
const size_t array_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
const size_t bytes = array_size + (init_capacity << elem_size_lg2);
upb_Array* array = (upb_Array*)upb_Arena_Malloc(arena, bytes);
if (!array) return NULL;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)
(array, UPB_PTR_AT(array, array_size, void), elem_size_lg2);
array->size = 0;
array->UPB_PRIVATE(capacity) = init_capacity;
return array;
}
// Resizes the capacity of the array to be at least min_size.
bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena);
bool UPB_PRIVATE(_upb_Array_Realloc)(upb_Array* array, size_t min_size,
upb_Arena* arena);
UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size,
upb_Arena* arena) {
if (arr->capacity < size) return _upb_array_realloc(arr, size, arena);
UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(upb_Array* array, size_t size,
upb_Arena* arena) {
if (array->UPB_PRIVATE(capacity) < size)
return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
return true;
}
// Resize without initializing new elements.
UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* arr, size_t size,
UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* array, size_t size,
upb_Arena* arena) {
UPB_ASSERT(size <= arr->size || arena); // Allow NULL arena when shrinking.
if (!_upb_array_reserve(arr, size, arena)) return false;
arr->size = size;
UPB_ASSERT(size <= array->size || arena); // Allow NULL arena when shrinking.
if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false;
array->size = size;
return true;
}
// This function is intended for situations where elem_size is compile-time
// constant or a known expression of the form (1 << lg2), so that the expression
// i*elem_size does not result in an actual multiplication.
UPB_INLINE void _upb_Array_Set(upb_Array* arr, size_t i, const void* data,
size_t elem_size) {
UPB_ASSERT(i < arr->size);
UPB_ASSERT(elem_size == 1U << _upb_Array_ElemSizeLg2(arr));
char* arr_data = (char*)_upb_array_ptr(arr);
UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(upb_Array* array, size_t i,
const void* data,
size_t elem_size) {
UPB_ASSERT(i < array->size);
UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
char* arr_data = (char*)_upb_array_ptr(array);
memcpy(arr_data + (i * elem_size), data, elem_size);
}
UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
*UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -3033,7 +3034,8 @@ UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
_upb_MiniTableField_CheckIsArray(field);
upb_Array* array = upb_Message_GetMutableArray(msg, field);
if (!array) {
array = _upb_Array_New(arena, 4, _upb_MiniTableField_ElemSizeLg2(field));
array = UPB_PRIVATE(_upb_Array_New)(arena, 4,
_upb_MiniTableField_ElemSizeLg2(field));
// Check again due to: https://godbolt.org/z/7WfaoKG1r
_upb_MiniTableField_CheckIsArray(field);
upb_MessageValue val;
@ -4095,7 +4097,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4513,7 +4515,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protob
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -4539,7 +4541,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescripto
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -4565,7 +4567,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -4591,7 +4593,7 @@ UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDe
}
struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -4617,7 +4619,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
@ -4665,7 +4667,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -4689,7 +4691,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
@ -5090,7 +5092,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5116,7 +5118,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorPro
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5142,7 +5144,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_Descripto
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5168,7 +5170,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobu
}
struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5194,7 +5196,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
@ -5232,7 +5234,7 @@ UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5258,7 +5260,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf
}
struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5282,7 +5284,7 @@ UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobu
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -5626,7 +5628,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot
}
struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
@ -5668,7 +5670,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -6345,7 +6347,7 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
}
struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
@ -6383,7 +6385,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_
}
struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
@ -6407,7 +6409,7 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -6718,7 +6720,7 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
}
struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
@ -7396,7 +7398,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -7618,7 +7620,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -7976,7 +7978,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
@ -8002,7 +8004,7 @@ UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_F
}
struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
@ -8040,7 +8042,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8242,7 +8244,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8426,7 +8428,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8591,7 +8593,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8737,7 +8739,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8902,7 +8904,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9092,7 +9094,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
}
struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
@ -9472,7 +9474,7 @@ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* g
}
struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
@ -9663,7 +9665,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
}
struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9865,7 +9867,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
@ -9889,7 +9891,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
@ -9921,7 +9923,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_com
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -10021,7 +10023,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
}
struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -10179,7 +10181,7 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {

@ -5559,7 +5559,7 @@ upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
const upb_MiniTable* sub, upb_Arena* arena) {
size_t size = array->size;
upb_Array* cloned_array =
_upb_Array_New(arena, size, upb_CType_SizeLg2(value_type));
UPB_PRIVATE(_upb_Array_New)(arena, size, upb_CType_SizeLg2(value_type));
if (!cloned_array) {
return NULL;
}
@ -5733,7 +5733,7 @@ upb_Message* upb_Message_DeepClone(const upb_Message* message,
// Must be last.
upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
return _upb_Array_New(a, 4, upb_CType_SizeLg2(type));
return UPB_PRIVATE(_upb_Array_New)(a, 4, upb_CType_SizeLg2(type));
}
const void* upb_Array_DataPtr(const upb_Array* arr) {
@ -5747,7 +5747,7 @@ size_t upb_Array_Size(const upb_Array* arr) { return arr->size; }
upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
upb_MessageValue ret;
const char* data = _upb_array_constptr(arr);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->size);
memcpy(&ret, data + (i << lg2), 1 << lg2);
return ret;
@ -5755,7 +5755,7 @@ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) {
char* data = _upb_array_ptr(arr);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->size);
memcpy(data + (i << lg2), &val, 1 << lg2);
}
@ -5771,7 +5771,7 @@ bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) {
void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx,
size_t count) {
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
char* data = _upb_array_ptr(arr);
memmove(&data[dst_idx << lg2], &data[src_idx << lg2], count << lg2);
}
@ -5808,20 +5808,19 @@ bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) {
}
const size_t newsize = arr->size;
if (newsize > oldsize) {
const int lg2 = _upb_Array_ElemSizeLg2(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
char* data = _upb_array_ptr(arr);
memset(data + (oldsize << lg2), 0, (newsize - oldsize) << lg2);
}
return true;
}
// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
bool _upb_array_realloc(upb_Array* arr, size_t min_capacity, upb_Arena* arena) {
size_t new_capacity = UPB_MAX(arr->capacity, 4);
const int lg2 = _upb_Array_ElemSizeLg2(arr);
size_t old_bytes = arr->capacity << lg2;
void* ptr = _upb_array_ptr(arr);
bool UPB_PRIVATE(_upb_Array_Realloc)(upb_Array* array, size_t min_capacity,
upb_Arena* arena) {
size_t new_capacity = UPB_MAX(array->UPB_PRIVATE(capacity), 4);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array);
size_t old_bytes = array->UPB_PRIVATE(capacity) << lg2;
void* ptr = _upb_array_ptr(array);
// Log2 ceiling of size.
while (new_capacity < min_capacity) new_capacity *= 2;
@ -5830,8 +5829,8 @@ bool _upb_array_realloc(upb_Array* arr, size_t min_capacity, upb_Arena* arena) {
ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes);
if (!ptr) return false;
_upb_Array_SetTaggedPtr(arr, ptr, lg2);
arr->capacity = new_capacity;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)(array, ptr, lg2);
array->UPB_PRIVATE(capacity) = new_capacity;
return true;
}
@ -12143,8 +12142,9 @@ static void _upb_Decoder_VerifyUtf8(upb_Decoder* d, const char* buf, int len) {
}
static bool _upb_Decoder_Reserve(upb_Decoder* d, upb_Array* arr, size_t elem) {
bool need_realloc = arr->capacity - arr->size < elem;
if (need_realloc && !_upb_array_realloc(arr, arr->size + elem, &d->arena)) {
bool need_realloc = arr->UPB_PRIVATE(capacity) - arr->size < elem;
if (need_realloc &&
!UPB_PRIVATE(_upb_Array_Realloc)(arr, arr->size + elem, &d->arena)) {
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
return need_realloc;
@ -12508,7 +12508,7 @@ upb_Array* _upb_Decoder_CreateArray(upb_Decoder* d,
const upb_MiniTableField* field) {
const upb_FieldType field_type = field->UPB_PRIVATE(descriptortype);
const size_t lg2 = upb_FieldType_SizeLg2(field_type);
upb_Array* ret = _upb_Array_New(&d->arena, 4, lg2);
upb_Array* ret = UPB_PRIVATE(_upb_Array_New)(&d->arena, 4, lg2);
if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
return ret;
}
@ -13532,15 +13532,15 @@ UPB_FORCEINLINE
static void* fastdecode_resizearr(upb_Decoder* d, void* dst,
fastdecode_arr* farr, int valbytes) {
if (UPB_UNLIKELY(dst == farr->end)) {
size_t old_capacity = farr->arr->capacity;
size_t old_capacity = farr->arr->UPB_PRIVATE(capacity);
size_t old_bytes = old_capacity * valbytes;
size_t new_capacity = old_capacity * 2;
size_t new_bytes = new_capacity * valbytes;
char* old_ptr = _upb_array_ptr(farr->arr);
char* new_ptr = upb_Arena_Realloc(&d->arena, old_ptr, old_bytes, new_bytes);
uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
_upb_Array_SetTaggedPtr(farr->arr, new_ptr, elem_size_lg2);
farr->arr->capacity = new_capacity;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)(farr->arr, new_ptr, elem_size_lg2);
farr->arr->UPB_PRIVATE(capacity) = new_capacity;
dst = (void*)(new_ptr + (old_capacity * valbytes));
farr->end = (void*)(new_ptr + (new_capacity * valbytes));
}
@ -13622,13 +13622,13 @@ static void* fastdecode_getfield(upb_Decoder* d, const char* ptr,
*(uint32_t*)msg |= *hasbits;
*hasbits = 0;
if (UPB_LIKELY(!*arr_p)) {
farr->arr = _upb_Array_New(&d->arena, 8, elem_size_lg2);
farr->arr = UPB_PRIVATE(_upb_Array_New)(&d->arena, 8, elem_size_lg2);
*arr_p = farr->arr;
} else {
farr->arr = *arr_p;
}
begin = _upb_array_ptr(farr->arr);
farr->end = begin + (farr->arr->capacity * valbytes);
farr->end = begin + (farr->arr->UPB_PRIVATE(capacity) * valbytes);
*data = _upb_FastDecoder_LoadTag(ptr);
return begin + (farr->arr->size * valbytes);
}
@ -13907,7 +13907,8 @@ TAGBYTES(p)
int elems = size / valbytes; \
\
if (UPB_LIKELY(!arr)) { \
*arr_p = arr = _upb_Array_New(&d->arena, elems, elem_size_lg2); \
*arr_p = arr = \
UPB_PRIVATE(_upb_Array_New)(&d->arena, elems, elem_size_lg2); \
if (!arr) { \
_upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \
} \

@ -2602,81 +2602,82 @@ struct upb_Array {
// Bit #2 contains the frozen/immutable flag (currently unimplemented).
uintptr_t data;
size_t size; // The number of elements in the array.
size_t capacity; // Allocated storage. Measured in elements.
size_t size; // The number of elements in the array.
size_t UPB_PRIVATE(capacity); // Allocated storage. Measured in elements.
};
// LINT.ThenChange(GoogleInternalName1)
UPB_INLINE void _upb_Array_SetTaggedPtr(upb_Array* arr, void* data,
size_t lg2) {
UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(upb_Array* array,
void* data, size_t lg2) {
UPB_ASSERT(lg2 != 1);
UPB_ASSERT(lg2 <= 4);
const size_t bits = lg2 - (lg2 != 0);
arr->data = (uintptr_t)data | bits;
array->data = (uintptr_t)data | bits;
}
UPB_INLINE size_t _upb_Array_ElemSizeLg2(const upb_Array* arr) {
const size_t bits = arr->data & _UPB_ARRAY_MASK_LG2;
UPB_INLINE size_t UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const upb_Array* array) {
const size_t bits = array->data & _UPB_ARRAY_MASK_LG2;
const size_t lg2 = bits + (bits != 0);
return lg2;
}
UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) {
_upb_Array_ElemSizeLg2(arr); // Check assertions.
return (void*)(arr->data & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
UPB_INLINE const void* _upb_array_constptr(const upb_Array* array) {
UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array); // Check assertions.
return (void*)(array->data & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
}
UPB_INLINE void* _upb_array_ptr(upb_Array* arr) {
return (void*)_upb_array_constptr(arr);
UPB_INLINE void* _upb_array_ptr(upb_Array* array) {
return (void*)_upb_array_constptr(array);
}
UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_capacity,
int elem_size_lg2) {
UPB_INLINE upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
size_t init_capacity,
int elem_size_lg2) {
UPB_ASSERT(elem_size_lg2 != 1);
UPB_ASSERT(elem_size_lg2 <= 4);
const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
const size_t bytes = arr_size + (init_capacity << elem_size_lg2);
upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes);
if (!arr) return NULL;
_upb_Array_SetTaggedPtr(arr, UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
arr->size = 0;
arr->capacity = init_capacity;
return arr;
const size_t array_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
const size_t bytes = array_size + (init_capacity << elem_size_lg2);
upb_Array* array = (upb_Array*)upb_Arena_Malloc(arena, bytes);
if (!array) return NULL;
UPB_PRIVATE(_upb_Array_SetTaggedPtr)
(array, UPB_PTR_AT(array, array_size, void), elem_size_lg2);
array->size = 0;
array->UPB_PRIVATE(capacity) = init_capacity;
return array;
}
// Resizes the capacity of the array to be at least min_size.
bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena);
bool UPB_PRIVATE(_upb_Array_Realloc)(upb_Array* array, size_t min_size,
upb_Arena* arena);
UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size,
upb_Arena* arena) {
if (arr->capacity < size) return _upb_array_realloc(arr, size, arena);
UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(upb_Array* array, size_t size,
upb_Arena* arena) {
if (array->UPB_PRIVATE(capacity) < size)
return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
return true;
}
// Resize without initializing new elements.
UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* arr, size_t size,
UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* array, size_t size,
upb_Arena* arena) {
UPB_ASSERT(size <= arr->size || arena); // Allow NULL arena when shrinking.
if (!_upb_array_reserve(arr, size, arena)) return false;
arr->size = size;
UPB_ASSERT(size <= array->size || arena); // Allow NULL arena when shrinking.
if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false;
array->size = size;
return true;
}
// This function is intended for situations where elem_size is compile-time
// constant or a known expression of the form (1 << lg2), so that the expression
// i*elem_size does not result in an actual multiplication.
UPB_INLINE void _upb_Array_Set(upb_Array* arr, size_t i, const void* data,
size_t elem_size) {
UPB_ASSERT(i < arr->size);
UPB_ASSERT(elem_size == 1U << _upb_Array_ElemSizeLg2(arr));
char* arr_data = (char*)_upb_array_ptr(arr);
UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(upb_Array* array, size_t i,
const void* data,
size_t elem_size) {
UPB_ASSERT(i < array->size);
UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
char* arr_data = (char*)_upb_array_ptr(array);
memcpy(arr_data + (i * elem_size), data, elem_size);
}
UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
*UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -3035,7 +3036,8 @@ UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
_upb_MiniTableField_CheckIsArray(field);
upb_Array* array = upb_Message_GetMutableArray(msg, field);
if (!array) {
array = _upb_Array_New(arena, 4, _upb_MiniTableField_ElemSizeLg2(field));
array = UPB_PRIVATE(_upb_Array_New)(arena, 4,
_upb_MiniTableField_ElemSizeLg2(field));
// Check again due to: https://godbolt.org/z/7WfaoKG1r
_upb_MiniTableField_CheckIsArray(field);
upb_MessageValue val;
@ -4599,7 +4601,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -5017,7 +5019,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protob
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -5043,7 +5045,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescripto
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -5069,7 +5071,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -5095,7 +5097,7 @@ UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDe
}
struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -5121,7 +5123,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
@ -5169,7 +5171,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -5193,7 +5195,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
@ -5594,7 +5596,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5620,7 +5622,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorPro
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5646,7 +5648,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_Descripto
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5672,7 +5674,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobu
}
struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5698,7 +5700,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
@ -5736,7 +5738,7 @@ UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5762,7 +5764,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf
}
struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -5786,7 +5788,7 @@ UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobu
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -6130,7 +6132,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot
}
struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
@ -6172,7 +6174,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -6849,7 +6851,7 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
}
struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
@ -6887,7 +6889,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_
}
struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
@ -6911,7 +6913,7 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -7222,7 +7224,7 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
}
struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
@ -7900,7 +7902,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8122,7 +8124,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8480,7 +8482,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
@ -8506,7 +8508,7 @@ UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_F
}
struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
@ -8544,7 +8546,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8746,7 +8748,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -8930,7 +8932,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9095,7 +9097,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9241,7 +9243,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9406,7 +9408,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -9596,7 +9598,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
}
struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
@ -9976,7 +9978,7 @@ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* g
}
struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
@ -10167,7 +10169,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
}
struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -10369,7 +10371,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
@ -10393,7 +10395,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
@ -10425,7 +10427,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_com
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -10525,7 +10527,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
}
struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -10683,7 +10685,7 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {

@ -280,7 +280,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -698,7 +698,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protob
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -724,7 +724,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescripto
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -750,7 +750,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescr
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -776,7 +776,7 @@ UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDe
}
struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -802,7 +802,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
@ -850,7 +850,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
@ -874,7 +874,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
@ -1275,7 +1275,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1301,7 +1301,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorPro
}
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1327,7 +1327,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_Descripto
}
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1353,7 +1353,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobu
}
struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1379,7 +1379,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
@ -1417,7 +1417,7 @@ UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_Descript
}
struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1443,7 +1443,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf
}
struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
@ -1467,7 +1467,7 @@ UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobu
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -1811,7 +1811,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot
}
struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
@ -1853,7 +1853,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -2530,7 +2530,7 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
}
struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
@ -2568,7 +2568,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_
}
struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
@ -2592,7 +2592,7 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -2903,7 +2903,7 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
}
struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
@ -3581,7 +3581,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -3803,7 +3803,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4161,7 +4161,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
@ -4187,7 +4187,7 @@ UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_F
}
struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
@ -4225,7 +4225,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4427,7 +4427,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4611,7 +4611,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4776,7 +4776,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -4922,7 +4922,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -5087,7 +5087,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
}
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -5277,7 +5277,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
}
struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
@ -5657,7 +5657,7 @@ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* g
}
struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
@ -5848,7 +5848,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
}
struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -6050,7 +6050,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
@ -6074,7 +6074,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
@ -6106,7 +6106,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_com
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
@ -6206,7 +6206,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
}
struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
@ -6364,7 +6364,7 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val));
return true;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {

Loading…
Cancel
Save