We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5fcec8b + 640516b commit e6c5365Copy full SHA for e6c5365
threading/smartptrs.nim
@@ -108,9 +108,9 @@ proc newSharedPtr*[T](t: typedesc[T]): SharedPtr[T] =
108
## Returns a shared pointer. It is not initialized,
109
## so reading from it before writing to it is undefined behaviour!
110
when not supportsCopyMem(T):
111
- result.val = cast[typeof(result.val)](allocShared0(sizeof(T)))
+ result.val = cast[typeof(result.val)](allocShared0(sizeof(result.val[])))
112
else:
113
- result.val = cast[typeof(result.val)](allocShared(sizeof(T)))
+ result.val = cast[typeof(result.val)](allocShared(sizeof(result.val[])))
114
int(result.val.counter) = 0
115
116
proc isNil*[T](p: SharedPtr[T]): bool {.inline.} =
0 commit comments