mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
15
tests/objects/tunsafenew2.nim
Normal file
15
tests/objects/tunsafenew2.nim
Normal file
@@ -0,0 +1,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)
|
||||
Reference in New Issue
Block a user