Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 693895069
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Nov 8, 2024
1 parent 492029b commit 9b716e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions upb/mem/arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@ void upb_Arena_DecRefFor(const upb_Arena* a, const void* owner) {
upb_Arena_Free((upb_Arena*)a);
}

upb_alloc* upb_Arena_GetUpbAlloc(upb_Arena* a) {
upb_ArenaInternal* ai = upb_Arena_Internal(a);
return _upb_ArenaInternal_BlockAlloc(ai);
}

void UPB_PRIVATE(_upb_Arena_SwapIn)(upb_Arena* des, const upb_Arena* src) {
upb_ArenaInternal* desi = upb_Arena_Internal(des);
upb_ArenaInternal* srci = upb_Arena_Internal(src);
Expand Down
3 changes: 3 additions & 0 deletions upb/mem/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ UPB_API void upb_Arena_Free(upb_Arena* a);
UPB_API bool upb_Arena_Fuse(const upb_Arena* a, const upb_Arena* b);
UPB_API bool upb_Arena_IsFused(const upb_Arena* a, const upb_Arena* b);

// Returns the upb_alloc used by the arena.
UPB_API upb_alloc* upb_Arena_GetUpbAlloc(upb_Arena* a);

bool upb_Arena_IncRefFor(const upb_Arena* a, const void* owner);
void upb_Arena_DecRefFor(const upb_Arena* a, const void* owner);

Expand Down

0 comments on commit 9b716e3

Please sign in to comment.