* fixes #11807
* make tests green again
This commit is contained in:
Andreas Rumpf 2019-08-07 22:40:58 +02:00 • committed by GitHub
commit c0d240b8cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 14 deletions

View file

@ -1,7 +1,8 @@
discard """
cmd: '''nim cpp --newruntime $file'''
output: '''(field: "value")
3 3 new: 0'''
Indeed
0 new: 0'''
"""
import core / allocators
@ -13,10 +14,15 @@ type
Node = ref object
field: string
# bug #11807
import os
putEnv("HEAPTRASHING", "Indeed")
proc main =
var w = newTable[string, owned Node]()
w["key"] = Node(field: "value")
echo w["key"][]
echo getEnv("HEAPTRASHING")
main()
@ -41,4 +47,4 @@ type
var t: MyType
let (a, d) = allocCounters()
discard cprintf("%ld %ld new: %ld\n", a, d, allocs)
discard cprintf("%ld new: %ld\n", a - unpairedEnvAllocs() - d, allocs)