add memory (test) ds

This commit is contained in:
Jaremy Creechley 2023-08-28 19:44:41 -07:00 committed by Dmitriy Ryajov
parent a7f6794f7e
commit 23423e52a9
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
2 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ method get*(
let dk = KeyBuffer.new(key)
echo "getting: ", key
for k, v in self.store.pairs():
print "get: ", k.toString()
print "get: ", k.toString(), " v: ", v.toString().repr
if self.store.hasKey(dk):
let res = self.store[dk]

View File

@ -43,8 +43,8 @@ proc thread1(val: int) {.thread.} =
var myBytes = DataBuffer.new(@"hello world")
myBytes2 = myBytes
echo "thread1: sending: ", myBytes, " cnt: ", myBytes.unsafeGetAtomicCount()
echo "mybytes2: ", myBytes2, " cnt: ", myBytes2.unsafeGetAtomicCount()
echo "thread1: sending: ", myBytes
echo "mybytes2: ", myBytes2
shareVal = myBytes
echo "thread1: sent, left over: ", $myBytes
@ -60,7 +60,7 @@ proc thread2(val: int) {.thread.} =
wait(cond, lock)
echo "thread2: receiving "
let msg: DataBuffer = shareVal
echo "thread2: received: ", msg, " cnt: ", msg.unsafeGetAtomicCount()
echo "thread2: received: ", msg
check msg.toSeq(char) == @"hello world"
# os.sleep(100)