aboutsummaryrefslogtreecommitdiff
path: root/src/threading.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 14:44:22 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 14:44:22 +0100
commitd1450e3d880ec70b306dc735f7f694f265348ef1 (patch)
tree401e1864c2552cb0ac7f6c7c92a1673bb80015b6 /src/threading.cpp
parenteff46c2e5f325fc5b8422a9bc1d59436db13b471 (diff)
Fix styling issues
Diffstat (limited to 'src/threading.cpp')
-rw-r--r--src/threading.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/threading.cpp b/src/threading.cpp
index ac79efb05..ff0fdfcde 100644
--- a/src/threading.cpp
+++ b/src/threading.cpp
@@ -66,9 +66,9 @@ struct Thread {
#endif
isize idx;
- isize stack_size;
+ isize stack_size;
- struct TaskQueue queue;
+ struct TaskQueue queue;
struct ThreadPool *pool;
};
@@ -560,10 +560,10 @@ gb_internal void *internal_thread_proc(void *arg) {
}
#endif
-TaskRingBuffer *taskring_init(isize size) {
- TaskRingBuffer *ring = (TaskRingBuffer *)gb_alloc(heap_allocator(), sizeof(TaskRingBuffer));
+TaskRingBuffer *task_ring_init(isize size) {
+ TaskRingBuffer *ring = gb_alloc_item(heap_allocator(), TaskRingBuffer);
ring->size = size;
- ring->buffer = (WorkerTask *)gb_alloc_array(heap_allocator(), WorkerTask, ring->size);
+ ring->buffer = gb_alloc_array(heap_allocator(), WorkerTask, ring->size);
return ring;
}
@@ -581,7 +581,7 @@ gb_internal void thread_init(ThreadPool *pool, Thread *t, isize idx) {
#endif
// Size must be a power of 2
- t->queue.ring = taskring_init(1 << 14);
+ t->queue.ring = task_ring_init(1 << 14);
t->pool = pool;
t->idx = idx;
}