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