From: MARK CALLAGHAN Date: February 27 2009 5:13am Subject: Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueries List-Archive: http://lists.mysql.com/internals/36303 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Feb 26, 2009 at 6:13 PM, Monty Taylor wrote: > Brian Aker wrote: >> Hi! >> >> On Feb 26, 2009, at 12:21 PM, Mats Kindahl wrote: >> >>> recycling. In that case, any pointers into that old memory that are sti= ll >>> dangling would not be useful, since the memory is likely to be >>> overwritten with >> >> mem_root or not mem_root... I consider this to be pretty bad behavior to >> rely on. > > Not mem_root. C++ has much better ways of dealing with this sort of > thing (automatic delloc when you're done with stuff) mem_root was likely > very important when it was written, and a great idea then. > > Now it's just extra complexity that hides behavior. > > Monty My C++ skills have faded given what I work on. What does C++ have that is similar to mem_root? That is, I want an allocator to be used with a variety of STL classes for which I will deallocate everyting all at once but at some random point in the future. And since I don't want to have to retain handles to everything that has been allocated, I prefer to invoke deallocate on the allocator rather than all of the objects that have been allocated from it. > > -- > MySQL Internals Mailing List > For list archives: http://lists.mysql.com/internals > To unsubscribe: =A0 =A0http://lists.mysql.com/internals?unsub=3Dmdcallag@= gmail.com > > --=20 Mark Callaghan mdcallag@stripped