summary refs log tree commit diff stats
path: root/tests/objects/tunsafenew2.nim
blob: 83112bcfcac5180cb3581455181abc863ba3dd59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
valgrind: "leaks"
matrix: "-d:useMalloc"
targets: "c cpp"
"""

type
  Obj = object
    case b: bool
    else: discard
    a: UncheckedArray[byte]

var o: ref Obj
unsafeNew(o, sizeof(Obj) + 512)
zeroMem(addr o.a, 512)