• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #ifndef UPB_INT_H_
3 #define UPB_INT_H_
4 
5 #include "upb/upb.h"
6 
7 struct mem_block;
8 typedef struct mem_block mem_block;
9 
10 struct upb_arena {
11   _upb_arena_head head;
12   uint32_t *cleanups;
13 
14   /* Allocator to allocate arena blocks.  We are responsible for freeing these
15    * when we are destroyed. */
16   upb_alloc *block_alloc;
17   uint32_t last_size;
18 
19   /* When multiple arenas are fused together, each arena points to a parent
20    * arena (root points to itself). The root tracks how many live arenas
21    * reference it. */
22   uint32_t refcount;  /* Only used when a->parent == a */
23   struct upb_arena *parent;
24 
25   /* Linked list of blocks to free/cleanup. */
26   mem_block *freelist, *freelist_tail;
27 };
28 
29 #endif  /* UPB_INT_H_ */
30