arena
| Member Type | Member Name |
|---|---|
enum arena_allocation_type | type |
uint16_t | meta_pages |
uint16_t | reserved |
uint32_t | magic |
| Member Type | Member Name |
|---|---|
struct hugepage_meta_common | common |
uint8_t | order_of_block[512] |
| Member Type | Member Name |
|---|---|
size_t | obj_size |
size_t | obj_count |
void | *free_list |
uint8_t | *alloc_bitmap |
| Member Type | Member Name |
|---|---|
struct spinlock | lock |
struct minheap | *hugepages |
size_t | max_hpages |
struct hugepage_tb | *tb |
enum arena_flags | flags |
enum arena_allocation_type | preferred |
| Name | Value |
|---|---|
ARENA_ALLOCATION_TYPE_BITMAP | 0 |
ARENA_ALLOCATION_TYPE_BUDDY | 1 |
ARENA_ALLOCATION_TYPE_SLAB | 2 |
ARENA_ALLOCATION_TYPE_BUMP | 3 |
ARENA_ALLOCATION_TYPE_DEFAULT | ARENA_ALLOCATION_TYPE_BITMAP |
| Name | Value |
|---|---|
ARENA_FLAGS_DEMAND_ALLOC | (1 << 0) |
ARENA_FLAGS_RECLAIM_FREED | (1 << 1) |
ARENA_FLAGS_ALLOW_UNSAFE_DESTROY | (1 << 2) |
ARENA_FLAGS_SET_MAX_HUGEPAGES | (1 << 3) |
ARENA_FLAGS_RECYCLE | (1 << 4) |
ARENA_FLAGS_PRIVATE_HTB | (1 << 5) |
ARENA_FLAGS_ALWAYS_CREATE_NEW | (1 << 6) |
ARENA_FLAGS_DEFAULT | `ARENA_FLAGS_RECLAIM_FREED |
static inline boolarena_can_demand_alloc(struct arena*a)static inline boolarena_can_reclaim_freed(struct arena*a)static inline boolarena_allows_unsafe_destroy(struct arena*a)static inline boolarena_has_hugepage_limit(struct arena*a)static inline boolarena_should_recycle(struct arena*a)static inline boolarena_has_private_htb(struct arena*a)static inline boolarena_must_alloc_new(struct arena*a)struct arena *arena_init(enum arena_flagsflags,enum arena_allocation_typetype)struct arena *arena_init_default(void)struct arena *arena_init_with_limit(enum arena_flagsflags,enum arena_allocation_typetype,size_t hp_limit)struct arena *arena_init_from_hugepage(struct hugepage *hp,enum arena_flagsflags,enum arena_allocation_typetype)struct arena *arena_init_from_hugepage_with_limit(struct hugepage *hp,enum arena_flagsflags,enum arena_allocation_typetype,size_t hp_limit)voidarena_insert_hugepage(struct arena*a,struct hugepage *hp)
Defines
Section titled “Defines”ARENA_HTB_SIZE:16