From 609976ce86c9decafce3cef61500f62bcd1bc455 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 13 Sep 2023 11:18:22 -0700 Subject: [PATCH] fix compilation --- datastore/threads/sharedptr.nim | 4 ++-- tests/datastore/testdatabuffer.nim | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datastore/threads/sharedptr.nim b/datastore/threads/sharedptr.nim index ee3c301..307aa68 100644 --- a/datastore/threads/sharedptr.nim +++ b/datastore/threads/sharedptr.nim @@ -32,7 +32,7 @@ proc decr*[T](x: var SharedPtr[T]) = if x.val != nil and x.cnt != nil: let res = atomicSubFetch(x.cnt, 1, ATOMIC_ACQUIRE) if res == 0: - echo "SharedPtr: FREE: ", repr x.val.pointer, " ", x[].cnt[], " tp: ", $(typeof(T)) + echo "SharedPtr: FREE: ", repr x.val.pointer, " ", x.cnt[], " tp: ", $(typeof(T)) when compiles(`=destroy`(x.val)): echo "DECR FREE" `=destroy`(x.val) @@ -100,4 +100,4 @@ template `[]=`*[T](p: SharedPtr[T]; val: T) = proc `$`*[T](p: SharedPtr[T]): string {.inline.} = if p.val == nil: "nil" - else: "(val: " & $p.val.value & ")" \ No newline at end of file + else: "(val: " & $p.val[] & ")" diff --git a/tests/datastore/testdatabuffer.nim b/tests/datastore/testdatabuffer.nim index 92d8e1f..ffa3f25 100644 --- a/tests/datastore/testdatabuffer.nim +++ b/tests/datastore/testdatabuffer.nim @@ -8,7 +8,7 @@ import pkg/unittest2 import pkg/questionable import pkg/questionable/results -include ../../datastore/databuffer +include pkg/datastore/threads/databuffer var shareVal: DataBuffer @@ -26,8 +26,8 @@ proc thread1(val: int) {.thread.} = var myBytes = DataBuffer.new(@"hello world") myBytes2 = myBytes - echo "thread1: sending: ", myBytes - echo "mybytes2: ", myBytes2 + echo "thread1: sending: ", $myBytes + echo "mybytes2: ", $myBytes2 shareVal = myBytes echo "thread1: sent, left over: ", $myBytes