From: <dan...@ya...> - 2001-11-28 20:55:34
|
--- Thomas Pfaff <tp...@gm...> wrote: > > > On Wed, 28 Nov 2001, Danny Smith wrote: > > > Your patch does indeed fix a memory leak with 2.95.3. However, there > does > > not appear to be any leak (using your testcase) on 3.1, with or without > > your patch. I'm guessing that EH code cleans up after itself better > in > > GCC 3.1. > > If you can give me an ftp access to your gcc-3.1 snapshot i will take a > look at it. > Sorry gcc core and g++ src about 12MB gzipped. My connection is very slow. I won't be uploading 3.1 srcs and binaries anywhere until I'm sure I won't have to do it again soon. I can send gcc/gthr-win32.h and gcc/unwind-sjlj.c (where libgcc's generic exception code lives) or you can grab those from gcc CVS > > > > Is patch necessary or beneficial for other reasons? Can you comment on > > performance costs of your patch versus Mumit's version? > > > > This patch was only meant to create TLS keys similar to > pthread_key_create, where you can give a dtor function that will be > called > on thread termination. Look at Mumits comments in mthr.c > Unfortunately his implementation was not correct and has lead to memory > leaks. Therefore it does not matter which code is faster (i guess Mumits > is because free() is only called once ;-) ). > > If my patch is not neccessary with gcc-3.1 you can forget Mumits version > as well. You can easily try this if you link the program without > libmingthrd.a. If there is no differende than the mthr code is simply not > needed (at least whith thread exception cleanup). > I have tried 3.1 without -mthreads switch and these are results calls free delta mem 0 101912 0 1000 101872 -40 2000 101924 12 3000 101924 12 4000 101916 4 5000 101908 -4 6000 101936 24 7000 101928 16 8000 101928 16 9000 101928 16 10000 101936 24 11000 101936 24 12000 101928 16 13000 101928 16 14000 101876 -36 15000 101876 -36 16000 101848 -64 17000 101856 -56 18000 101856 -56 19000 101828 -84 20000 101828 -84 21000 101864 -48 22000 101864 -48 23000 101856 -56 24000 101876 -36 25000 101868 -44 26000 101868 -44 27000 101868 -44 28000 101884 -28 29000 101884 -28 No apparent leak I need to study unwind-sjlj.c some more to follow what is actually happening I won't push the patch to gthr-win32.h for gcc-3.1 foe awhile. Feel free to do so yourself if you can answer the questions that will come back from that list. Please understand that I am not criticising your efforts. I am just having trouble with what is for me a very steep learning curve. Danny > > _______________________________________________ > MinGW-dvlpr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr http://shopping.yahoo.com.au - Yahoo! Shopping - Get organised for Christmas early this year! |