From b270d986c642808417342c922ec882ad441fd956 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Tue, 20 Feb 2024 16:10:39 -0700 Subject: [PATCH] cleanup --- src/apatheia/queues.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apatheia/queues.nim b/src/apatheia/queues.nim index f7e7643..73c6997 100644 --- a/src/apatheia/queues.nim +++ b/src/apatheia/queues.nim @@ -12,8 +12,8 @@ export chronos type ChanPtr[T] = ptr Channel[T] -proc allocSharedChannel[T](): ChanPtr[T] = - cast[ChanPtr[T]](allocShared0(sizeof(Channel[T]))) +proc allocPtr[T](): ptr T = + cast[ptr T](allocShared0(sizeof(T))) type SignalQueue*[T] = object signal: ThreadSignalPtr @@ -32,7 +32,7 @@ proc newSignalQueue*[T]( if res.isErr(): raise newException(ApatheiaSignalErr, res.error()) result.signal = res.get() - result.chan = allocSharedChannel[T]() + result.chan = allocPtr[Channel[T]]() result.chan[].open(maxItems) proc send*[T](c: SignalQueue[T], msg: sink T): Result[void, string] {.raises: [].} =