Merge pull request #5110 from yglukhov/leaks
More workarounds for #5098
This commit is contained in:
commit
9099fdd8f0
3 changed files with 11 additions and 3 deletions
|
|
@ -160,7 +160,10 @@ proc peekLast*[T](deq: Deque[T]): T {.inline.} =
|
||||||
emptyCheck(deq)
|
emptyCheck(deq)
|
||||||
result = deq.data[(deq.tail - 1) and deq.mask]
|
result = deq.data[(deq.tail - 1) and deq.mask]
|
||||||
|
|
||||||
proc default[T](t: typedesc[T]): T {.inline.} = discard
|
template default[T](t: typedesc[T]): T =
|
||||||
|
var v: T
|
||||||
|
v
|
||||||
|
|
||||||
proc popFirst*[T](deq: var Deque[T]): T {.inline, discardable.} =
|
proc popFirst*[T](deq: var Deque[T]): T {.inline, discardable.} =
|
||||||
## Remove and returns the first element of the `deq`.
|
## Remove and returns the first element of the `deq`.
|
||||||
emptyCheck(deq)
|
emptyCheck(deq)
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,10 @@ proc add*[T](q: var Queue[T], item: T) =
|
||||||
q.data[q.wr] = item
|
q.data[q.wr] = item
|
||||||
q.wr = (q.wr + 1) and q.mask
|
q.wr = (q.wr + 1) and q.mask
|
||||||
|
|
||||||
proc default[T](t: typedesc[T]): T {.inline.} = discard
|
template default[T](t: typedesc[T]): T =
|
||||||
|
var v: T
|
||||||
|
v
|
||||||
|
|
||||||
proc pop*[T](q: var Queue[T]): T {.inline, discardable.} =
|
proc pop*[T](q: var Queue[T]): T {.inline, discardable.} =
|
||||||
## Remove and returns the first (oldest) element of the queue `q`.
|
## Remove and returns the first (oldest) element of the queue `q`.
|
||||||
emptyCheck(q)
|
emptyCheck(q)
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,9 @@ template doWhile(a, b) =
|
||||||
b
|
b
|
||||||
if not a: break
|
if not a: break
|
||||||
|
|
||||||
proc default[T](t: typedesc[T]): T {.inline.} = discard
|
template default[T](t: typedesc[T]): T =
|
||||||
|
var v: T
|
||||||
|
v
|
||||||
|
|
||||||
proc excl*[A](s: var HashSet[A], key: A) =
|
proc excl*[A](s: var HashSet[A], key: A) =
|
||||||
## Excludes `key` from the set `s`.
|
## Excludes `key` from the set `s`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue