1 Aug 2008 01:25
Re: GDB to C++ issue: deletion
Paul Hilfinger <hilfingr <at> EECS.Berkeley.EDU>
2008-07-31 23:25:18 GMT
2008-07-31 23:25:18 GMT
> > 1. Ahem, which is precisely why I used a new subject, so as not to > > incorporate an incidental side discussion into the same thread! > > Sorry. You replied to the same thread; most current Unix mailers > will thread such replies together regardless of subject. I didn't > even notice. How "helpful" of them. Sorry; I didn't edit my header stringently enough. My bad. > > 2. On the other hand, if someone is going to claim the advantages of > > not having to do delete as an advantage, it is not entirely > > unreasonable to make sure it really works out that way in practice. > > IMO that applies to short lived variables, not the sort of things that > get obstacked at all. Actually, I had already concluded that short-lived variables would NOT be a great problem. To a first approximation, the effect of using STL's storage management is to increase allocation costs by some constant factor, because deallocation cost for an object tends to be limited by some constant times its allocation cost. As long as GDB's allocation costs are not huge (and the constant factors are not huge), we shouldn't have much pain. But that's just an overall argument about total execution time. Common sources of short-lived variables (say during parsing and (sub)expression evaluation) don't produce that many variables between prompts (usually). What I was more interested in was the possibility(Continue reading)
It should not be "How to I translate the
code in lines 30 through 42 from C to C++?" but "The C code in lines
30 through 42 solves problem X. How would I solve X in C++?"
(yes, custom allocators might be a solution to certain generic
allocation performance problems, but the solution more often is
something different.)
RSS Feed