Hi Fred,

> In theroy, you are correct, but as long as char doesn't have a destructor,
>  this is totally overkill, and not very efficient.

If the type has no destructor, it won't be called, so the efficiency argument is
moot. But the real issue is that calling "delete" on an array has undefined
behaviour. While it often works in practice (because often delete [] defers to 
delete), it can cause heap corruption (depending on the runtime library or if 
the delete implementations have been overridden). Additionally, you'll make
valgrind puke :-) (and rightly so)

See
  http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.13

cheers,

        Manuel





------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to