From 6b96d7b0ad73e6ed63cf5e32fd2544121e2b0284 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 26 Jun 2023 11:35:23 -0400 Subject: ioq: Don't check NDEBUG manually in ioqq_trypop() --- src/ioq.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ioq.c b/src/ioq.c index 47b082a..617bd5f 100644 --- a/src/ioq.c +++ b/src/ioq.c @@ -248,12 +248,9 @@ static union ioq_cmd *ioqq_trypop(struct ioqq *ioqq) { prev &= ~IOQ_BLOCKED; if (prev) { -#ifdef NDEBUG - store(&ioqq->tail, i + IOQ_STRIDE, relaxed); -#else - size_t j = fetch_add(&ioqq->tail, IOQ_STRIDE, relaxed); + size_t j = exchange(&ioqq->tail, i + IOQ_STRIDE, relaxed); bfs_assert(j == i, "ioqq_trypop() only supports a single consumer"); -#endif + (void)j; } return (union ioq_cmd *)prev; -- cgit v1.2.3