-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trigger valgrind failure on memory leak
- Loading branch information
Showing
9 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:arc -d:useMalloc $options $file" | ||
""" | ||
|
||
# test that a memory leak is caught by valgrind | ||
discard alloc(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:arc $options $file" | ||
exitcode: 0 | ||
""" | ||
|
||
# unlike tleak_arc_useMalloc.nim, tleak_arc_noUseMalloc.nim is powerless to | ||
# detect the memory leak because malloc is not used | ||
discard alloc(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:arc -d:useMalloc $options $file" | ||
exitcode: 1 | ||
outputsub: " definitely lost: 7 bytes in 2 blocks" | ||
""" | ||
|
||
discard alloc(3) | ||
discard alloc(4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:orc $options $file" | ||
exitcode: 0 | ||
""" | ||
|
||
# unlike tleak_orc_useMalloc.nim, tleak_orc_noUseMalloc.nim is powerless to | ||
# detect the memory leak because malloc is not used | ||
discard alloc(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:orc -d:useMalloc $options $file" | ||
exitcode: 1 | ||
outputsub: " definitely lost: 7 bytes in 2 blocks" | ||
""" | ||
|
||
discard alloc(3) | ||
discard alloc(4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
discard """ | ||
valgrind: true | ||
cmd: "nim $target --gc:refc -d:useMalloc $options $file" | ||
exitcode: 0 | ||
""" | ||
|
||
# Valgrind cannot detect this leak even if malloc is used because --gc:refc | ||
discard alloc(1) |