tregionleak.nim 288 B

123456789101112131415161718192021222324
  1. discard """
  2. cmd: '''nim c --gc:regions $file'''
  3. output: '''
  4. finalized
  5. finalized
  6. '''
  7. """
  8. proc finish(o: RootRef) =
  9. echo "finalized"
  10. withScratchRegion:
  11. var test: RootRef
  12. new(test, finish)
  13. var
  14. mr: MemRegion
  15. test: RootRef
  16. withRegion(mr):
  17. new(test, finish)
  18. deallocAll(mr)