Auto-generate files after cl/722720783

pull/20203/head
Protobuf Team Bot 3 months ago
parent d5d69e0927
commit b4c246762c
  1. 51
      php/ext/google/protobuf/php-upb.c
  2. 52
      php/ext/google/protobuf/php-upb.h
  3. 51
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 52
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -113,7 +113,13 @@ Error, UINTPTR_MAX is undefined
#ifdef __clang__
#define UPB_ALIGN_OF(type) _Alignof(type)
#else
#define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
#define UPB_ALIGN_OF(type) \
offsetof( \
struct { \
char c; \
type member; \
}, \
member)
#endif
#ifdef _MSC_VER
@ -148,7 +154,8 @@ Error, UINTPTR_MAX is undefined
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#define UPB_PRINTF(str, first_vararg) \
__attribute__((format(printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE static
@ -169,11 +176,15 @@ Error, UINTPTR_MAX is undefined
// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
#ifdef NDEBUG
#ifdef __GNUC__
#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
#define UPB_ASSUME(expr) \
if (!(expr)) __builtin_unreachable()
#elif defined _MSC_VER
#define UPB_ASSUME(expr) if (!(expr)) __assume(0)
#define UPB_ASSUME(expr) \
if (!(expr)) __assume(0)
#else
#define UPB_ASSUME(expr) do {} while (false && (expr))
#define UPB_ASSUME(expr) \
do { \
} while (false && (expr))
#endif
#else
#define UPB_ASSUME(expr) assert(expr)
@ -182,13 +193,19 @@ Error, UINTPTR_MAX is undefined
/* UPB_ASSERT(): in release mode, we use the expression without letting it be
* evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define UPB_ASSERT(expr) do {} while (false && (expr))
#define UPB_ASSERT(expr) \
do { \
} while (false && (expr))
#else
#define UPB_ASSERT(expr) assert(expr)
#endif
#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
__builtin_unreachable(); \
} while (0)
#elif defined(_MSC_VER)
#define UPB_UNREACHABLE() \
do { \
@ -196,7 +213,16 @@ Error, UINTPTR_MAX is undefined
__assume(0); \
} while (0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
} while (0)
#endif
#ifdef __ANDROID__
#define UPB_DEFAULT_MAX_BLOCK_SIZE 8192;
#else
#define UPB_DEFAULT_MAX_BLOCK_SIZE 32768;
#endif
/* UPB_SETJMP() / UPB_LONGJMP() */
@ -356,10 +382,8 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#else
#define UPB_ASAN 0
#define UPB_ASAN_GUARD_SIZE 0
#define UPB_POISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#endif
#if defined(__SANITIZE_THREAD__) || UPB_CLANG_TSAN
@ -2937,7 +2961,7 @@ upb_alloc upb_alloc_global = {&upb_global_allocfunc};
// Must be last.
static UPB_ATOMIC(size_t) g_max_block_size = 32 << 10;
static UPB_ATOMIC(size_t) g_max_block_size = UPB_DEFAULT_MAX_BLOCK_SIZE;
void upb_Arena_SetMaxBlockSize(size_t max) {
upb_Atomic_Store(&g_max_block_size, max, memory_order_relaxed);
@ -17571,6 +17595,7 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
#undef UPB_DEFAULT_MAX_BLOCK_SIZE
#undef UPB_SETJMP
#undef UPB_LONGJMP
#undef UPB_PTRADD

@ -112,7 +112,13 @@ Error, UINTPTR_MAX is undefined
#ifdef __clang__
#define UPB_ALIGN_OF(type) _Alignof(type)
#else
#define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
#define UPB_ALIGN_OF(type) \
offsetof( \
struct { \
char c; \
type member; \
}, \
member)
#endif
#ifdef _MSC_VER
@ -147,7 +153,8 @@ Error, UINTPTR_MAX is undefined
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#define UPB_PRINTF(str, first_vararg) \
__attribute__((format(printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE static
@ -168,11 +175,15 @@ Error, UINTPTR_MAX is undefined
// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
#ifdef NDEBUG
#ifdef __GNUC__
#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
#define UPB_ASSUME(expr) \
if (!(expr)) __builtin_unreachable()
#elif defined _MSC_VER
#define UPB_ASSUME(expr) if (!(expr)) __assume(0)
#define UPB_ASSUME(expr) \
if (!(expr)) __assume(0)
#else
#define UPB_ASSUME(expr) do {} while (false && (expr))
#define UPB_ASSUME(expr) \
do { \
} while (false && (expr))
#endif
#else
#define UPB_ASSUME(expr) assert(expr)
@ -181,13 +192,19 @@ Error, UINTPTR_MAX is undefined
/* UPB_ASSERT(): in release mode, we use the expression without letting it be
* evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define UPB_ASSERT(expr) do {} while (false && (expr))
#define UPB_ASSERT(expr) \
do { \
} while (false && (expr))
#else
#define UPB_ASSERT(expr) assert(expr)
#endif
#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
__builtin_unreachable(); \
} while (0)
#elif defined(_MSC_VER)
#define UPB_UNREACHABLE() \
do { \
@ -195,7 +212,16 @@ Error, UINTPTR_MAX is undefined
__assume(0); \
} while (0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
} while (0)
#endif
#ifdef __ANDROID__
#define UPB_DEFAULT_MAX_BLOCK_SIZE 8192;
#else
#define UPB_DEFAULT_MAX_BLOCK_SIZE 32768;
#endif
/* UPB_SETJMP() / UPB_LONGJMP() */
@ -355,10 +381,8 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#else
#define UPB_ASAN 0
#define UPB_ASAN_GUARD_SIZE 0
#define UPB_POISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#endif
#if defined(__SANITIZE_THREAD__) || UPB_CLANG_TSAN
@ -820,6 +844,9 @@ UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
size_t size);
static const size_t UPB_PRIVATE(kUpbDefaultMaxBlockSize) =
UPB_DEFAULT_MAX_BLOCK_SIZE;
// Sets the maximum block size for all arenas. This is a global configuration
// setting that will affect all existing and future arenas. If
// upb_Arena_Malloc() is called with a size larger than this, we will exceed
@ -16000,6 +16027,7 @@ upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
#undef UPB_DEFAULT_MAX_BLOCK_SIZE
#undef UPB_SETJMP
#undef UPB_LONGJMP
#undef UPB_PTRADD

@ -113,7 +113,13 @@ Error, UINTPTR_MAX is undefined
#ifdef __clang__
#define UPB_ALIGN_OF(type) _Alignof(type)
#else
#define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
#define UPB_ALIGN_OF(type) \
offsetof( \
struct { \
char c; \
type member; \
}, \
member)
#endif
#ifdef _MSC_VER
@ -148,7 +154,8 @@ Error, UINTPTR_MAX is undefined
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#define UPB_PRINTF(str, first_vararg) \
__attribute__((format(printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE static
@ -169,11 +176,15 @@ Error, UINTPTR_MAX is undefined
// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
#ifdef NDEBUG
#ifdef __GNUC__
#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
#define UPB_ASSUME(expr) \
if (!(expr)) __builtin_unreachable()
#elif defined _MSC_VER
#define UPB_ASSUME(expr) if (!(expr)) __assume(0)
#define UPB_ASSUME(expr) \
if (!(expr)) __assume(0)
#else
#define UPB_ASSUME(expr) do {} while (false && (expr))
#define UPB_ASSUME(expr) \
do { \
} while (false && (expr))
#endif
#else
#define UPB_ASSUME(expr) assert(expr)
@ -182,13 +193,19 @@ Error, UINTPTR_MAX is undefined
/* UPB_ASSERT(): in release mode, we use the expression without letting it be
* evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define UPB_ASSERT(expr) do {} while (false && (expr))
#define UPB_ASSERT(expr) \
do { \
} while (false && (expr))
#else
#define UPB_ASSERT(expr) assert(expr)
#endif
#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
__builtin_unreachable(); \
} while (0)
#elif defined(_MSC_VER)
#define UPB_UNREACHABLE() \
do { \
@ -196,7 +213,16 @@ Error, UINTPTR_MAX is undefined
__assume(0); \
} while (0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
} while (0)
#endif
#ifdef __ANDROID__
#define UPB_DEFAULT_MAX_BLOCK_SIZE 8192;
#else
#define UPB_DEFAULT_MAX_BLOCK_SIZE 32768;
#endif
/* UPB_SETJMP() / UPB_LONGJMP() */
@ -356,10 +382,8 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#else
#define UPB_ASAN 0
#define UPB_ASAN_GUARD_SIZE 0
#define UPB_POISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#endif
#if defined(__SANITIZE_THREAD__) || UPB_CLANG_TSAN
@ -2937,7 +2961,7 @@ upb_alloc upb_alloc_global = {&upb_global_allocfunc};
// Must be last.
static UPB_ATOMIC(size_t) g_max_block_size = 32 << 10;
static UPB_ATOMIC(size_t) g_max_block_size = UPB_DEFAULT_MAX_BLOCK_SIZE;
void upb_Arena_SetMaxBlockSize(size_t max) {
upb_Atomic_Store(&g_max_block_size, max, memory_order_relaxed);
@ -17047,6 +17071,7 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
#undef UPB_DEFAULT_MAX_BLOCK_SIZE
#undef UPB_SETJMP
#undef UPB_LONGJMP
#undef UPB_PTRADD

@ -114,7 +114,13 @@ Error, UINTPTR_MAX is undefined
#ifdef __clang__
#define UPB_ALIGN_OF(type) _Alignof(type)
#else
#define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
#define UPB_ALIGN_OF(type) \
offsetof( \
struct { \
char c; \
type member; \
}, \
member)
#endif
#ifdef _MSC_VER
@ -149,7 +155,8 @@ Error, UINTPTR_MAX is undefined
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#define UPB_PRINTF(str, first_vararg) \
__attribute__((format(printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE static
@ -170,11 +177,15 @@ Error, UINTPTR_MAX is undefined
// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
#ifdef NDEBUG
#ifdef __GNUC__
#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
#define UPB_ASSUME(expr) \
if (!(expr)) __builtin_unreachable()
#elif defined _MSC_VER
#define UPB_ASSUME(expr) if (!(expr)) __assume(0)
#define UPB_ASSUME(expr) \
if (!(expr)) __assume(0)
#else
#define UPB_ASSUME(expr) do {} while (false && (expr))
#define UPB_ASSUME(expr) \
do { \
} while (false && (expr))
#endif
#else
#define UPB_ASSUME(expr) assert(expr)
@ -183,13 +194,19 @@ Error, UINTPTR_MAX is undefined
/* UPB_ASSERT(): in release mode, we use the expression without letting it be
* evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define UPB_ASSERT(expr) do {} while (false && (expr))
#define UPB_ASSERT(expr) \
do { \
} while (false && (expr))
#else
#define UPB_ASSERT(expr) assert(expr)
#endif
#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
__builtin_unreachable(); \
} while (0)
#elif defined(_MSC_VER)
#define UPB_UNREACHABLE() \
do { \
@ -197,7 +214,16 @@ Error, UINTPTR_MAX is undefined
__assume(0); \
} while (0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
} while (0)
#endif
#ifdef __ANDROID__
#define UPB_DEFAULT_MAX_BLOCK_SIZE 8192;
#else
#define UPB_DEFAULT_MAX_BLOCK_SIZE 32768;
#endif
/* UPB_SETJMP() / UPB_LONGJMP() */
@ -357,10 +383,8 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#else
#define UPB_ASAN 0
#define UPB_ASAN_GUARD_SIZE 0
#define UPB_POISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define UPB_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#endif
#if defined(__SANITIZE_THREAD__) || UPB_CLANG_TSAN
@ -822,6 +846,9 @@ UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
size_t size);
static const size_t UPB_PRIVATE(kUpbDefaultMaxBlockSize) =
UPB_DEFAULT_MAX_BLOCK_SIZE;
// Sets the maximum block size for all arenas. This is a global configuration
// setting that will affect all existing and future arenas. If
// upb_Arena_Malloc() is called with a size larger than this, we will exceed
@ -15813,6 +15840,7 @@ upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
#undef UPB_DEFAULT_MAX_BLOCK_SIZE
#undef UPB_SETJMP
#undef UPB_LONGJMP
#undef UPB_PTRADD

Loading…
Cancel
Save