t19364.nim 699 B

12345678910111213141516171819202122232425262728293031
  1. discard """
  2. cmd: '''nim c --gc:arc --expandArc:fooLeaks $file'''
  3. nimout: '''
  4. --expandArc: fooLeaks
  5. var
  6. tmpTuple_cursor
  7. a_cursor
  8. b_cursor
  9. c_cursor
  10. tmpTuple_cursor = refTuple
  11. a_cursor = tmpTuple_cursor[0]
  12. b_cursor = tmpTuple_cursor[1]
  13. c_cursor = tmpTuple_cursor[2]
  14. -- end of expandArc ------------------------
  15. '''
  16. """
  17. func fooLeaks(refTuple: tuple[a,
  18. b,
  19. c: seq[float]]): float =
  20. let (a, b, c) = refTuple
  21. let refset = (a: newSeq[float](25_000_000),
  22. b: newSeq[float](25_000_000),
  23. c: newSeq[float](25_000_000))
  24. var res = newSeq[float](1_000_000)
  25. for i in 0 .. res.high:
  26. res[i] = fooLeaks(refset)