switch to tuple shared ptr

This commit is contained in:
Jaremy Creechley 2023-09-13 12:40:07 -07:00
parent 94090b2f4f
commit 88bf70cb5f
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -77,7 +77,7 @@ template newSharedPtr*[T](val: T): SharedPtr[T] =
proc newSharedPtr*[T](t: typedesc[T]): SharedPtr[T] =
## Returns a shared pointer. It is not initialized,
result.container = cast[typeof(result.container)](allocShared0(sizeof(result.container[])))
result.cnt[] = 1
result.container.cnt = 1
echo "SharedPtr: alloc: ", result.container[].repr, " tp: ", $(typeof(T))
proc isNil*[T](p: SharedPtr[T]): bool {.inline.} =