Re: [Flightgear-devel] valgrind: diff no 1

2008-01-20 Thread Melchior FRANZ
Hi, you have to know that FlightGear has never had a common coding style (at least not since I'm contributor, that is 2001/3). The rule was always that who starts writing a file decides for a style, and everyone adding to that file later respects this style. (There are exceptions, such as when a f

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread till busch
hi melchior, On Saturday 19 January 2008, Melchior FRANZ wrote: > * [EMAIL PROTECTED] -- Saturday 19 January 2008: > > and i am starting to do general clean-ups and optimizations > > (e.g. replacing serveral if - else if - else if... with switch) > > Don't do that! Switch *may* sometimes be the be

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Jon S. Berndt
> I have found memory leaks due to mismatched new/delete in > JSBsim (and submitted patches to fix the problem). > And JSBsim is very far from being the only place in > FGFS where c-- style manual memory management is used, > as detailed above. I appreciate any bug reports, and others have run val

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread John Denker
On 01/19/2008 07:47 AM, Tim Moore wrote: > I know for a fact that many of those allocations and assignments use smart > pointers. OK. > How about a more useful list of those that don't? Good idea. Here you go: If we exclude files that make *any* mention of 'SGSharedPtr' or 'ref_ptr' then it

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Melchior FRANZ
* [EMAIL PROTECTED] -- Saturday 19 January 2008: > and i am starting to do general clean-ups and optimizations > (e.g. replacing serveral if - else if - else if... with switch) Don't do that! Switch *may* sometimes be the better solution, and very often it isn't. When I used if/else-if somewhere,

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread buti
On Saturday 19 January 2008, John Denker wrote: > ... > Forsooth it would make sense to *start* by > cleaning up the source i.e. getting rid of needlessly non-automatic > memory management (rather than starting with valgrind), for > several reasons: > a) It's just plain easier to look at the sou

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Tim Moore
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 till busch wrote: | hi all, | | i've started to run fg through valgrind. i found this to be a nice option for | getting an overview over the code in flightgear. | | i plan to prepare some patches to fix various issues reported by valgrind. | this is th

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Frederic Bouvier
Jon S. Berndt a écrit : >> [hundreds of lines of grep output omitted] >> >> I know for a fact that many of those allocations and assignments use >> smart pointers. How about a more useful list of those that don't? >> >> Thanks in advance, >> Tim >> > > And some others appear to me to be proper

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Jon S. Berndt
> [hundreds of lines of grep output omitted] > > I know for a fact that many of those allocations and assignments use > smart pointers. How about a more useful list of those that don't? > > Thanks in advance, > Tim And some others appear to me to be properly used. I'm perplexed by the previous

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Tim Moore
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Denker wrote: | On 01/19/2008 03:40 AM, Tim Moore wrote: | |>> osg::ref_ptr and SGSharedPtr which should be used for all long-lived, |>> shared objects. | | Ah, "should be". There is presently a noticeable gap between | what "is" and what "shoul

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread John Denker
On 01/19/2008 03:40 AM, Tim Moore wrote: >> Actually, we want to avoid writing explicit deletes as much as possible, as >> that >> need is the source of most memory leaks. Yes indeed. >> We have two classes for smart, reference- >> counted pointers, osg::ref_ptr and SGSharedPtr which should be

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-19 Thread Tim Moore
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Denker wrote: | On 01/18/2008 09:05 AM, till busch wrote: | |> i've started to run fg through valgrind. i found this to be a nice option for |> getting an overview over the code in flightgear. | | 1) This is important, valuable, and overdue. | | 2

Re: [Flightgear-devel] valgrind: diff no 1

2008-01-18 Thread John Denker
On 01/18/2008 09:05 AM, till busch wrote: > i've started to run fg through valgrind. i found this to be a nice option for > getting an overview over the code in flightgear. 1) This is important, valuable, and overdue. 2) It's going to be a lot of work. That's because 2a) Although it is easy

[Flightgear-devel] valgrind: diff no 1

2008-01-18 Thread till busch
hi all, i've started to run fg through valgrind. i found this to be a nice option for getting an overview over the code in flightgear. i plan to prepare some patches to fix various issues reported by valgrind. this is the first in (i hope) a series of several patches yet to follow. i couldn't