From 4b6de0f00b0b42e380abf91b5dcc105392ebb775 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 29 Mar 2024 19:09:40 +0000 Subject: [PATCH] Auto-generate files after cl/620303837 --- php/ext/google/protobuf/php-upb.h | 10 +++++++--- ruby/ext/google/protobuf_c/ruby-upb.h | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 5c1080afa9..79b808bc8b 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -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); diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index fb7684be5f..2dc2ee51d8 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -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);