More often or not when I get a warning from Delphi about a Var that is never used it either a complete mistake on the part of the compiler OR because I have pre-initialized and changing it depends upon an If...then clause which us never entered into on a build!
from: Robert Meek at: [EMAIL PROTECTED] dba "Tangentals Design" home of "PoBoy" freeware Windows apps and utilities located at: www.TangentalsDesign.com e-mail to: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Nelson Sent: Thursday, June 09, 2005 11:27 AM To: Borland's Delphi Discussion List Subject: Re: problem in memory management? Heh, that's strange. At risk of getting off subject, I will be brief. I have never seen Delphi (pre 2005) lose track of variables without some serious memory trashing on my (or someone's) part. i've worked on some big projects, and sometimes you get a rougue programmer that doesn't know the meaning of try->finally or doesn't follow consistent patters of create->free in such a way that something gets freed twice, or something is used after being freed. The better warnings that were introduced in D3 or D4 (don't remember when) really helped this a lot. I made it a policy to clean up every single one of them just to make sure that noone was doing anything ridiculous. For example the hint that "x is declared but never used" might prompt you to look through your code and figure out why it was declared... at which point to might find that misuse of an array index was causing memory to be written to that was well out of the bounds of an allocated array. --Jason ----- Original Message ----- From: "Tim" <[EMAIL PROTECTED]> To: "Borland's Delphi Discussion List" <[email protected]> Sent: Thursday, June 09, 2005 12:18 AM Subject: Re: problem in memory management? > At 21:37 08/06/2005, you wrote: > >>I think it is unlikely Delphi 2005's fault. However, if you are using the >>"inline" directive, I have noticed some cases where the compiler loses >>track of which variable is which... even in simple things like FOR loops. >>If you're not using inline, then I would guess that this complex type is >>being misused/misallocated. A more detailed code sample would be helpful. > > Yes, I have noticed the same thing (Delphi losing track of variables) in > D3, D4, D5, D6 and D7. > > To get around it (I have never figured out what causes it), I normally > rewrite the loop so that it is no longer a for loop. But I have also > noticed it using inc(var). > > Regards > > Tim > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

