It looks like there's a memory leak in getAppFilename(). When running the code below, memory usage continuously grows and finally results in a "out of memory" error on my system.
import os
while true:
var s = getAppFilename()
sleep(1)
I stumbled over it while using the logging lib, where getAppFilename() is always called in proc substituteLog().
I am using the devel branch under windows with gcc and with --threads:on and --tlsEmulation:on switches.
Update: With boehm gc memory usage stays constant.
Nim Compiler Version 0.12.1 (2015-11-25) [Windows: amd64]
Copyright (c) 2006-2015 by Andreas Rumpf
git hash: eaed36092c5caa5854dcdb4bb205a3c1050e323c
active boot switches: -d:release
Before posting an issue I want to make sure that this is not something related to my environment.
Update: With boehm gc memory usage stays constant.
when defined(windows):
when useWinUnicode:
var buf = cast[WideCString](alloc(256*2))
var len = getModuleFileNameW(0, buf, 256)
result = buf$len
else:
result = newString(256)
var len = getModuleFileNameA(0, result, 256)
setlen(result, int(len))
If useWinUnicode is true this indeed seems to leak.