mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-08-02 04:43:16 +00:00
testing finalizers
This commit is contained in:
parent
cf891184a9
commit
3212ce1ff0
@ -100,7 +100,6 @@ method put*(
|
||||
block:
|
||||
var fa: FutureAlloc
|
||||
fa.new(faFinalizer)
|
||||
|
||||
echo "FA NEW! ", cast[pointer](fa).repr
|
||||
|
||||
let (ret, reallysignal) = await newThreadResult(void)
|
||||
|
||||
@ -103,9 +103,11 @@ proc `decr`*(x: SharedSignalPtr) =
|
||||
else:
|
||||
echo "SIGNAL: decr: ", repr x.buf.pointer, " ", x.cnt[]
|
||||
|
||||
import std/strutils
|
||||
|
||||
proc `=destroy`*(x: var SharedSignalPtr) =
|
||||
echo "SIGNAL: destroy: ", repr x.buf.pointer, " ", x.cnt.repr
|
||||
echo "SIGNAL: destroy:st: ", $getStackTrace()
|
||||
echo "SIGNAL: destroy:st: ", ($getStackTrace()).split("\n").join(";")
|
||||
|
||||
decr(x)
|
||||
|
||||
|
||||
@ -32,10 +32,11 @@ proc testThreadProxy() =
|
||||
data = "value for 1".toBytes()
|
||||
|
||||
test "check put":
|
||||
for i in 1..2:
|
||||
for i in 1..20:
|
||||
echo "\n\n=== put ==="
|
||||
let res1 = await sds.put(key1, data)
|
||||
check res1.isOk
|
||||
GC_fullCollect()
|
||||
# GC_fullCollect()
|
||||
# print "res1: ", res1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user