summaryrefslogtreecommitdiff
path: root/source/kit/allocator.c
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-02-11 18:17:33 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-02-11 18:17:33 +0100
commitdf00df5a7a5bcd9076d4423128ea014ab3535626 (patch)
tree337e62f8ca39b19b250b155a3fbeb495384e356b /source/kit/allocator.c
parent80da54bb97c279aa60fb77a9bbad9baa0f2e4477 (diff)
downloadsaw-df00df5a7a5bcd9076d4423128ea014ab3535626.zip
Update kit
Diffstat (limited to 'source/kit/allocator.c')
-rw-r--r--source/kit/allocator.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/kit/allocator.c b/source/kit/allocator.c
index e1446ac..9fd7bad 100644
--- a/source/kit/allocator.c
+++ b/source/kit/allocator.c
@@ -160,6 +160,7 @@ static void *kit_allocate_from_buffer_(kit_allocator_t *alloc,
assert(0);
return NULL;
}
+
#ifndef KIT_ENABLE_CUSTOM_ALLOC_DISPATCH
void *kit_alloc_dispatch(kit_allocator_t *alloc, i32 request,
i64 size, i64 previous_size, void *pointer) {
@@ -186,16 +187,13 @@ void *kit_alloc_dispatch(kit_allocator_t *alloc, i32 request,
#endif
kit_allocator_t kit_alloc_default(void) {
- kit_allocator_t alloc = { .type = KIT_ALLOC_TYPE_DEFAULT,
- .size = 0,
- .data = NULL };
- return alloc;
+ return (kit_allocator_t) { .type = KIT_ALLOC_TYPE_DEFAULT,
+ .size = 0,
+ .data = NULL };
}
kit_allocator_t kit_alloc_buffer(i64 size, void *buffer) {
- kit_allocator_t alloc = { .type = KIT_ALLOC_TYPE_BUFFER,
- .size = size,
- .data = buffer };
-
- return alloc;
+ return (kit_allocator_t) { .type = KIT_ALLOC_TYPE_BUFFER,
+ .size = size,
+ .data = buffer };
}