Skip to content

Commit

Permalink
Merge pull request #15980 from protocolbuffers/regen-upb
Browse files Browse the repository at this point in the history
Updated amalgamations for PHP and Ruby.
  • Loading branch information
haberman committed Feb 27, 2024
2 parents b5d4b40 + 9dfa2b6 commit 99c55ba
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test_php.yml
Expand Up @@ -154,7 +154,9 @@ jobs:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
version: ['8.2', '8.3']
# TODO: Add back 8.2 once
# https://github.com/shivammathur/setup-php/issues/823 is fixed.
version: ['8.3']

name: MacOS PHP ${{ matrix.version }}
runs-on: macos-12
Expand Down
5 changes: 4 additions & 1 deletion php/ext/google/protobuf/php-upb.c
Expand Up @@ -4571,9 +4571,10 @@ static upb_ArenaRoot _upb_Arena_FindRoot(upb_Arena* a) {
return (upb_ArenaRoot){.root = ai, .tagged_count = poc};
}

size_t upb_Arena_SpaceAllocated(upb_Arena* arena) {
size_t upb_Arena_SpaceAllocated(upb_Arena* arena, size_t* fused_count) {
upb_ArenaInternal* ai = _upb_Arena_FindRoot(arena).root;
size_t memsize = 0;
size_t local_fused_count = 0;

while (ai != NULL) {
upb_MemBlock* block = upb_Atomic_Load(&ai->blocks, memory_order_relaxed);
Expand All @@ -4582,8 +4583,10 @@ size_t upb_Arena_SpaceAllocated(upb_Arena* arena) {
block = upb_Atomic_Load(&block->next, memory_order_relaxed);
}
ai = upb_Atomic_Load(&ai->next, memory_order_relaxed);
local_fused_count++;
}

if (fused_count) *fused_count = local_fused_count;
return memsize;
}

Expand Down
4 changes: 2 additions & 2 deletions php/ext/google/protobuf/php-upb.h
Expand Up @@ -347,7 +347,7 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);

// Must be last.

#define _kUpb_Status_MaxMessage 127
#define _kUpb_Status_MaxMessage 511

typedef struct {
bool ok;
Expand Down Expand Up @@ -778,7 +778,7 @@ UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner);
void upb_Arena_DecRefFor(upb_Arena* a, const void* owner);

size_t upb_Arena_SpaceAllocated(upb_Arena* a);
size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count);
uint32_t upb_Arena_DebugRefCount(upb_Arena* a);

UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
Expand Down
5 changes: 4 additions & 1 deletion ruby/ext/google/protobuf_c/ruby-upb.c
Expand Up @@ -4085,9 +4085,10 @@ static upb_ArenaRoot _upb_Arena_FindRoot(upb_Arena* a) {
return (upb_ArenaRoot){.root = ai, .tagged_count = poc};
}

size_t upb_Arena_SpaceAllocated(upb_Arena* arena) {
size_t upb_Arena_SpaceAllocated(upb_Arena* arena, size_t* fused_count) {
upb_ArenaInternal* ai = _upb_Arena_FindRoot(arena).root;
size_t memsize = 0;
size_t local_fused_count = 0;

while (ai != NULL) {
upb_MemBlock* block = upb_Atomic_Load(&ai->blocks, memory_order_relaxed);
Expand All @@ -4096,8 +4097,10 @@ size_t upb_Arena_SpaceAllocated(upb_Arena* arena) {
block = upb_Atomic_Load(&block->next, memory_order_relaxed);
}
ai = upb_Atomic_Load(&ai->next, memory_order_relaxed);
local_fused_count++;
}

if (fused_count) *fused_count = local_fused_count;
return memsize;
}

Expand Down
4 changes: 2 additions & 2 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Expand Up @@ -349,7 +349,7 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);

// Must be last.

#define _kUpb_Status_MaxMessage 127
#define _kUpb_Status_MaxMessage 511

typedef struct {
bool ok;
Expand Down Expand Up @@ -780,7 +780,7 @@ UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner);
void upb_Arena_DecRefFor(upb_Arena* a, const void* owner);

size_t upb_Arena_SpaceAllocated(upb_Arena* a);
size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count);
uint32_t upb_Arena_DebugRefCount(upb_Arena* a);

UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
Expand Down

0 comments on commit 99c55ba

Please sign in to comment.