77 current = current->
next;
91 while(current->
next) {
92 current = current->
next;
121 current = current->
next;
138 current = current->
next;
192 current = current->
next;
199 current->
next = page;
200 page->
prev = current;
208 page->
next = current;
210 current->
prev = page;
void * memcpy(void *dest, void const *source, size_t size)
void * memset(void *dest, int c, size_t size)
void(* dealloc)(struct allocator *alloc, void *mem)
void *(* alloc)(struct allocator *alloc, size_t size)
tpa_t * tpa_new(allocator_t *alloc, uint64_t entry_size, uint64_t page_size, tpa_t *tpa)
struct tpa_page_header * prev
void tpa_delete(tpa_t *tpa)
uint64_t entry_size
Size of each entry.
uint64_t * tpa_get_marker(tpa_t *tpa, struct tpa_page_header *page, uint64_t idx)
allocator_t * allocator
Allocator for new tpa pages.
size_t tpa_size(tpa_t *tpa)
uint64_t start_idx
First index in this page.
struct tpa_page_header * next
Pointer to the next page.
uint64_t tpa_offset_in_page(tpa_t *tpa, uint64_t idx)
size_t tpa_next(tpa_t *tpa, size_t cur)
bool tpa_entry_exists_in_page(tpa_t *tpa, struct tpa_page_header *page, uint64_t idx)
void * tpa_get(tpa_t *tpa, uint64_t idx)
ssize_t tpa_length(tpa_t *tpa)
void tpa_set(tpa_t *tpa, uint64_t idx, void *data)
size_t tpa_entries(tpa_t *tpa)
struct tpa_page_header * first
Pointer to the first data page.
uint64_t page_size
Size of each data page.
size_t tpa_entries_per_page(tpa_t *tpa)
void tpa_clean_page(tpa_t *tpa, struct tpa_page_header *page)
struct tpa_page_header * tpa_get_page_for_idx(tpa_t *tpa, uint64_t idx)