Re: [Plib-devel] Memory leaks, was: GL_COLOR_MATERIAL pitfall
Brought to you by:
sjbaker
From: Michael K. <neg...@ea...> - 2000-05-01 08:38:03
|
This is getting rather off topic from the list, unless everyone wants to read about memory management and auto garbage collectors. ----- Original Message ----- From: Eero Pajarre <epa...@ko...> To: <pli...@li...> Sent: Monday, May 01, 2000 12:57 AM Subject: Re: [Plib-devel] Memory leaks, was: GL_COLOR_MATERIAL pitfall > > Also, a pointer may accidentially point to what can be concidered a "live" > > block of ram - one that you have write access to - but that does not mean it > > is a valid block of ram that you should be writing to, in all likelyhood > > you'll be overwriting part of your program or data. > > > > It might be useful to clear all the pointers which are not > pointing to valid data. > Yes, thank you. The point is that automatic garbage collectors do not work well, in my opinion. Obviously nothing beats paying attention to what you are doing. But turning a blind eye towards your pointers and hoping that a garbage collector "does the right thing" is not a good idea. I would much rather use a program that identified memory leaks during development, and ship an optimized program, than to include garbage collector routines simply because it was easier. Perhaps it's simply different schools of thought. I write 3D applications that need performance. For me, personally, the overhead of garbage collection is not worth it - I would rather identify the flaws in my code and eliminate them. -Michael Kurth |