19struct tommy_allocator_entry_struct {
20 struct tommy_allocator_entry_struct* next;
22typedef struct tommy_allocator_entry_struct tommy_allocator_entry;
Allocator of fixed-size blocks.
Definition: tommyalloc.h:27
struct tommy_allocator_entry_struct * free_block
List of free blocks.
Definition: tommyalloc.h:28
struct tommy_allocator_entry_struct * used_segment
List of allocated segments.
Definition: tommyalloc.h:29
tommy_size_t count
Number of allocated blocks.
Definition: tommyalloc.h:32
tommy_size_t block_size
Block size.
Definition: tommyalloc.h:30
tommy_size_t align_size
Alignment size.
Definition: tommyalloc.h:31
TOMMY_API void tommy_allocator_free(tommy_allocator *alloc, void *ptr)
Deallocates a block.
TOMMY_API void tommy_allocator_done(tommy_allocator *alloc)
Deinitializes the allocator.
TOMMY_API void * tommy_allocator_alloc(tommy_allocator *alloc)
Allocates a block.
struct tommy_allocator_struct tommy_allocator
Allocator of fixed-size blocks.
TOMMY_API tommy_size_t tommy_allocator_memory_usage(const tommy_allocator *alloc)
Gets the total size of allocated blocks currently in use.
TOMMY_API void tommy_allocator_init(tommy_allocator *alloc, tommy_size_t block_size, tommy_size_t align_size)
Initializes the allocator.
TOMMY_API void tommy_allocator_clear(tommy_allocator *alloc)
Releases all the allocated memory to the heap, including blocks still in use.
uint64_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:40