Auto-generate files after cl/620303837

pull/16354/head
Protobuf Team Bot 2024-03-29 19:09:40 +00:00
parent d51df2d2d7
commit 4b6de0f00b
2 changed files with 14 additions and 6 deletions

View File

@ -914,8 +914,8 @@ UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
upb_Arena* arena);
UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(struct upb_Array* array,
size_t size, upb_Arena* arena) {
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
upb_Arena* arena) {
UPB_ASSERT(!upb_Array_IsFrozen(array));
if (array->UPB_PRIVATE(capacity) < size)
return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
@ -928,7 +928,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
UPB_ASSERT(!upb_Array_IsFrozen(array));
UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
arena); // Allow NULL arena when shrinking.
if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false;
if (!upb_Array_Reserve(array, size, arena)) return false;
array->UPB_ONLYBITS(size) = size;
return true;
}
@ -1739,6 +1739,10 @@ UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
// REQUIRES: `i + count <= upb_Array_Size(arr)`
UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
// Reserves |size| elements of storage for the array.
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
upb_Arena* arena);
// Changes the size of a vector. New elements are initialized to NULL/0.
// Returns false on allocation failure.
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);

View File

@ -916,8 +916,8 @@ UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
upb_Arena* arena);
UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(struct upb_Array* array,
size_t size, upb_Arena* arena) {
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
upb_Arena* arena) {
UPB_ASSERT(!upb_Array_IsFrozen(array));
if (array->UPB_PRIVATE(capacity) < size)
return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
@ -930,7 +930,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
UPB_ASSERT(!upb_Array_IsFrozen(array));
UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
arena); // Allow NULL arena when shrinking.
if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false;
if (!upb_Array_Reserve(array, size, arena)) return false;
array->UPB_ONLYBITS(size) = size;
return true;
}
@ -1741,6 +1741,10 @@ UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
// REQUIRES: `i + count <= upb_Array_Size(arr)`
UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
// Reserves |size| elements of storage for the array.
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
upb_Arena* arena);
// Changes the size of a vector. New elements are initialized to NULL/0.
// Returns false on allocation failure.
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);