summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gc/gcleak.nim2
-rw-r--r--tests/gc/gcleak2.nim20
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/gc/gcleak.nim b/tests/gc/gcleak.nim
index 88aeda56d..a44c16f59 100644
--- a/tests/gc/gcleak.nim
+++ b/tests/gc/gcleak.nim
@@ -7,5 +7,5 @@ proc MakeObj(): TTestObj =
 
 while true:
   var obj = MakeObj()
-
+#  echo GC_getstatistics()
 
diff --git a/tests/gc/gcleak2.nim b/tests/gc/gcleak2.nim
new file mode 100644
index 000000000..5ab9da7c9
--- /dev/null
+++ b/tests/gc/gcleak2.nim
@@ -0,0 +1,20 @@
+type
+  TTestObj = object of TObject
+    x: string
+    s: seq[int]
+
+proc MakeObj(): TTestObj =
+  result.x = "Hello"
+  result.s = @[1,2,3]
+
+#while true:
+#  var obj = MakeObj()
+#  echo GC_getstatistics()
+
+proc inProc() = 
+  while true:
+    var obj: TTestObj
+    obj = MakeObj()
+
+inProc()
+