Auto-generate files after cl/613664457

pull/16098/head
Protobuf Team Bot 9 months ago
parent bcb4026c0c
commit ccfab6a8d5
  1. 24
      php/ext/google/protobuf/php-upb.c
  2. 18
      php/ext/google/protobuf/php-upb.h
  3. 24
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 18
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -6287,7 +6287,7 @@ typedef enum {
kUpb_LayoutItemType_Max = kUpb_LayoutItemType_Field,
} upb_LayoutItemType;
#define kUpb_LayoutItem_IndexSentinel ((uint16_t)-1)
#define kUpb_LayoutItem_IndexSentinel ((uint16_t) - 1)
typedef struct {
// Index of the corresponding field. When this is a oneof field, the field's
@ -6976,6 +6976,11 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
decoder->table->UPB_PRIVATE(dense_below) = 0;
decoder->table->UPB_PRIVATE(table_mask) = -1;
decoder->table->UPB_PRIVATE(required_count) = 0;
#if UPB_TRACING_ENABLED
// MiniTables built from MiniDescriptors will not be able to vend the message
// name unless it is explicitly set with upb_MiniTable_SetFullName().
decoder->table->UPB_PRIVATE(full_name) = 0;
#endif
// Strip off and verify the version tag.
if (!len--) goto done;
@ -11875,6 +11880,23 @@ bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
return true;
}
#if UPB_TRACING_ENABLED
static void (*_new_message_trace_handler)(const upb_MiniTable*,
const upb_Arena*);
void upb_Message_SetNewMessageTraceHandler(
void (*new_message_trace_handler)(const upb_MiniTable*, const upb_Arena*)) {
_new_message_trace_handler = new_message_trace_handler;
}
void upb_Message_LogNewMessage(const upb_MiniTable* mini_table,
const upb_Arena* arena) {
if (_new_message_trace_handler) {
_new_message_trace_handler(mini_table, arena);
}
}
#endif
const char _kUpb_ToBase92[] = {
' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',

@ -1492,6 +1492,7 @@ struct upb_MiniTable {
uint8_t UPB_PRIVATE(dense_below);
uint8_t UPB_PRIVATE(table_mask);
uint8_t UPB_PRIVATE(required_count); // Required fields have the low hasbits.
#ifdef UPB_TRACING_ENABLED
const char* UPB_PRIVATE(full_name);
#endif
@ -1599,6 +1600,13 @@ UPB_INLINE const char* upb_MiniTable_FullName(
const struct upb_MiniTable* mini_table) {
return mini_table->UPB_PRIVATE(full_name);
}
// Initializes tracing proto name from language runtimes that construct
// mini tables dynamically at runtime. The runtime is responsible for passing
// controlling lifetime of name such as storing in same arena as mini_table.
UPB_INLINE const char* upb_MiniTable_SetFullName(
struct upb_MiniTable* mini_table, char* full_name) {
mini_table->UPB_PRIVATE(full_name) = full_name;
}
#endif
#ifdef __cplusplus
@ -2433,9 +2441,19 @@ typedef struct upb_Message_Internal {
// char data[size - sizeof(upb_Message_Internal)];
} upb_Message_Internal;
#ifdef UPB_TRACING_ENABLED
void upb_Message_SetNewMessageTraceHandler(
void (*newMessageTraceHandler)(const upb_MiniTable*, const upb_Arena*));
void upb_Message_LogNewMessage(const upb_MiniTable* mini_table,
const upb_Arena* arena);
#endif
// Inline version upb_Message_New(), for internal use.
UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
upb_Arena* a) {
#ifdef UPB_TRACING_ENABLED
upb_Message_LogNewMessage(m, a);
#endif
const int size = m->UPB_PRIVATE(size);
struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
if (UPB_UNLIKELY(!msg)) return NULL;

@ -5801,7 +5801,7 @@ typedef enum {
kUpb_LayoutItemType_Max = kUpb_LayoutItemType_Field,
} upb_LayoutItemType;
#define kUpb_LayoutItem_IndexSentinel ((uint16_t)-1)
#define kUpb_LayoutItem_IndexSentinel ((uint16_t) - 1)
typedef struct {
// Index of the corresponding field. When this is a oneof field, the field's
@ -6490,6 +6490,11 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
decoder->table->UPB_PRIVATE(dense_below) = 0;
decoder->table->UPB_PRIVATE(table_mask) = -1;
decoder->table->UPB_PRIVATE(required_count) = 0;
#if UPB_TRACING_ENABLED
// MiniTables built from MiniDescriptors will not be able to vend the message
// name unless it is explicitly set with upb_MiniTable_SetFullName().
decoder->table->UPB_PRIVATE(full_name) = 0;
#endif
// Strip off and verify the version tag.
if (!len--) goto done;
@ -11389,6 +11394,23 @@ bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
return true;
}
#if UPB_TRACING_ENABLED
static void (*_new_message_trace_handler)(const upb_MiniTable*,
const upb_Arena*);
void upb_Message_SetNewMessageTraceHandler(
void (*new_message_trace_handler)(const upb_MiniTable*, const upb_Arena*)) {
_new_message_trace_handler = new_message_trace_handler;
}
void upb_Message_LogNewMessage(const upb_MiniTable* mini_table,
const upb_Arena* arena) {
if (_new_message_trace_handler) {
_new_message_trace_handler(mini_table, arena);
}
}
#endif
const char _kUpb_ToBase92[] = {
' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',

@ -1494,6 +1494,7 @@ struct upb_MiniTable {
uint8_t UPB_PRIVATE(dense_below);
uint8_t UPB_PRIVATE(table_mask);
uint8_t UPB_PRIVATE(required_count); // Required fields have the low hasbits.
#ifdef UPB_TRACING_ENABLED
const char* UPB_PRIVATE(full_name);
#endif
@ -1601,6 +1602,13 @@ UPB_INLINE const char* upb_MiniTable_FullName(
const struct upb_MiniTable* mini_table) {
return mini_table->UPB_PRIVATE(full_name);
}
// Initializes tracing proto name from language runtimes that construct
// mini tables dynamically at runtime. The runtime is responsible for passing
// controlling lifetime of name such as storing in same arena as mini_table.
UPB_INLINE const char* upb_MiniTable_SetFullName(
struct upb_MiniTable* mini_table, char* full_name) {
mini_table->UPB_PRIVATE(full_name) = full_name;
}
#endif
#ifdef __cplusplus
@ -2435,9 +2443,19 @@ typedef struct upb_Message_Internal {
// char data[size - sizeof(upb_Message_Internal)];
} upb_Message_Internal;
#ifdef UPB_TRACING_ENABLED
void upb_Message_SetNewMessageTraceHandler(
void (*newMessageTraceHandler)(const upb_MiniTable*, const upb_Arena*));
void upb_Message_LogNewMessage(const upb_MiniTable* mini_table,
const upb_Arena* arena);
#endif
// Inline version upb_Message_New(), for internal use.
UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
upb_Arena* a) {
#ifdef UPB_TRACING_ENABLED
upb_Message_LogNewMessage(m, a);
#endif
const int size = m->UPB_PRIVATE(size);
struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
if (UPB_UNLIKELY(!msg)) return NULL;

Loading…
Cancel
Save