> AFAIK mingw-w64 uses callbacks to reclaim TLS memory. In the first case, upon 
> destruction of the static object there were 5 blocks of memory unfreed; and 
> in the second case there were 6. If we say there was no memory leak in case 
> 1, then there must be in case 2, IMO.

I've tried this myself, and I think I'm seeing what you are seeing. It 
looks to me like the problem comes from ___w64_mingwthr_add_key_dtor in 
tlsthrd.c.  In this routine, calloc is called to create a 
__mingwthr_key_t.  However, I don't believe that memory ever gets freed.

In theory it could get freed in ___w64_mingwthr_remove_key_dtor (at 
least there is a free for it there), but apparently that routine never 
gets called.

Maybe it was supposed to be freed in __mingwthr_run_key_dtors when it 
gets called?

dw



------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to