|
|
|
@ -2969,7 +2969,7 @@ void upb_Arena_LogFree(const upb_Arena* arena) { |
|
|
|
|
} |
|
|
|
|
#endif // UPB_TRACING_ENABLED
|
|
|
|
|
|
|
|
|
|
static upb_ArenaRoot _upb_Arena_FindRoot(upb_Arena* a) { |
|
|
|
|
static upb_ArenaRoot _upb_Arena_FindRoot(const upb_Arena* a) { |
|
|
|
|
upb_ArenaInternal* ai = upb_Arena_Internal(a); |
|
|
|
|
uintptr_t poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire); |
|
|
|
|
while (_upb_Arena_IsTaggedPointer(poc)) { |
|
|
|
@ -3243,7 +3243,8 @@ static void _upb_Arena_DoFuseArenaLists(upb_ArenaInternal* const parent, |
|
|
|
|
upb_Atomic_Store(&parent->tail, parent_tail, memory_order_relaxed); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static upb_ArenaInternal* _upb_Arena_DoFuse(upb_Arena* a1, upb_Arena* a2, |
|
|
|
|
static upb_ArenaInternal* _upb_Arena_DoFuse(const upb_Arena* a1, |
|
|
|
|
const upb_Arena* a2, |
|
|
|
|
uintptr_t* ref_delta) { |
|
|
|
|
// `parent_or_count` has two distinct modes
|
|
|
|
|
// - parent pointer mode
|
|
|
|
@ -3315,7 +3316,7 @@ static bool _upb_Arena_FixupRefs(upb_ArenaInternal* new_root, |
|
|
|
|
memory_order_relaxed); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool upb_Arena_Fuse(upb_Arena* a1, upb_Arena* a2) { |
|
|
|
|
bool upb_Arena_Fuse(const upb_Arena* a1, const upb_Arena* a2) { |
|
|
|
|
if (a1 == a2) return true; // trivial fuse
|
|
|
|
|
|
|
|
|
|
#ifdef UPB_TRACING_ENABLED |
|
|
|
@ -3342,7 +3343,7 @@ bool upb_Arena_Fuse(upb_Arena* a1, upb_Arena* a2) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner) { |
|
|
|
|
bool upb_Arena_IncRefFor(const upb_Arena* a, const void* owner) { |
|
|
|
|
upb_ArenaInternal* ai = upb_Arena_Internal(a); |
|
|
|
|
if (_upb_ArenaInternal_HasInitialBlock(ai)) return false; |
|
|
|
|
upb_ArenaRoot r; |
|
|
|
@ -3361,7 +3362,9 @@ retry: |
|
|
|
|
goto retry; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void upb_Arena_DecRefFor(upb_Arena* a, const void* owner) { upb_Arena_Free(a); } |
|
|
|
|
void upb_Arena_DecRefFor(const upb_Arena* a, const void* owner) { |
|
|
|
|
upb_Arena_Free((upb_Arena*)a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UPB_PRIVATE(_upb_Arena_SwapIn)(upb_Arena* des, const upb_Arena* src) { |
|
|
|
|
upb_ArenaInternal* desi = upb_Arena_Internal(des); |
|
|
|
|