diff options
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 1baf283..b9e7eaf 100644 --- a/src/utils.c +++ b/src/utils.c @@ -9,8 +9,8 @@ struct allocator { size_t len; }; -Allocator newAllocator() { - Allocator alct = malloc(sizeof(struct allocator)); +allocator_t new_allocator() { + allocator_t alct = malloc(sizeof(struct allocator)); alct->bufs = malloc(sizeof(void*) * 16); alct->cap = 16; alct->len = 0; @@ -18,7 +18,7 @@ Allocator newAllocator() { return alct; } -void deleteAllocator(Allocator alct) { +void delete_allocator(allocator_t alct) { for (size_t i = 0; i < alct->len; i++) { free(alct->bufs[i]); } @@ -26,7 +26,7 @@ void deleteAllocator(Allocator alct) { free(alct); } -void * allocate(Allocator alct, size_t size) { +void * allocate(allocator_t alct, size_t size) { assert(size > 0); if (alct->len >= alct->cap) { alct->cap = alct->cap * 2; // Doubling the capacity |
