tregionleak.nim 301 B

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