From 9edd12e87874eabdc74e45359a5228558e124c98 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Thu, 8 Jan 2026 01:59:36 -0600 Subject: Add clay to project --- src/threadpool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/threadpool.c') diff --git a/src/threadpool.c b/src/threadpool.c index 7a2f93a..8c6b243 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -76,7 +76,7 @@ typedef struct ctqueue { task * task_new(gcallback callback, fcallback freecb, void *data) { if(callback == NULL) ERRRET(EINVAL, NULL); - task *tsk = calloc(1, sizeof(*tsk)); + task *tsk = VXGG_CALLOC(1, sizeof(*tsk)); if(!tsk) return NULL; tsk->callback = callback; @@ -129,7 +129,7 @@ int task_fired(task *tsk) { tqnode * tqnode_new(tqnode *next, tqnode *prev, task *tsk) { if(!tsk) ERRRET(EINVAL, NULL); - tqnode *node = calloc(1, sizeof(*node)); + tqnode *node = VXGG_CALLOC(1, sizeof(*node)); if(!node) return NULL; node->next = next; @@ -166,7 +166,7 @@ void tqnode_free(void *tqn) { * @retval (taskqueue*)[NULL, taskqueue*] Returns a new taskqueue object. Returns `null` and sets errno on error */ taskqueue * taskqueue_new(void) { - taskqueue *tq = calloc(1, sizeof(*tq)); + taskqueue *tq = VXGG_CALLOC(1, sizeof(*tq)); if(!tq) return NULL; tq->start = NULL; @@ -349,7 +349,7 @@ static void cndd_helper(cnd_t *cond) { ctqueue * ctqueue_init(int nthreads) { if(nthreads <= 0) ERRRET(EINVAL, NULL); - ctqueue *ctq = calloc(1, sizeof(*ctq)); + ctqueue *ctq = VXGG_CALLOC(1, sizeof(*ctq)); if(!ctq) return NULL; ctq->canceled = 0; @@ -361,7 +361,7 @@ ctqueue * ctqueue_init(int nthreads) { if(mtx_init(&ctq->mutex, mtx_plain) != thrd_success) goto ERR_ctqueue_init; if(cnd_init(&ctq->cond) != thrd_success) goto ERR_ctqueue_init; - ctq->thrdarr = calloc(ctq->talen, sizeof(thrd_t)); + ctq->thrdarr = VXGG_CALLOC(ctq->talen, sizeof(thrd_t)); if(!ctq->thrdarr) goto ERR_ctqueue_init; return ctq; -- cgit v1.2.3