The memory is probably not actually "leaked", but simply not deallocated as of 
program exit. See, e.g.: 
[https://stackoverflow.com/questions/31061326/why-valgrind-report-my-memory-as-definitely-lost](https://stackoverflow.com/questions/31061326/why-valgrind-report-my-memory-as-definitely-lost)

I'm not sure if the Nim-analogous `quit(0)` solution will work for the valgrind 
reporting. Worth a try.

Note that whatever you do to make valgrind give a nice report, you do not want 
to do all the time. When **NOT** testing for memory leaks it is **much faster** 
to let the OS reclaim memory pages/resources on process death. In an extreme 
case of memory swapped to Winchester drives aka spinning rust, the OS may be 
able to do it **millions of times** faster. A language run time will probably 
have to swap in all those evicted pages, probably even in some non-linear order 
seeking around.

Reply via email to