List:Internals« Previous MessageNext Message »
From:Konstantin Osipov Date:March 2 2009 8:18pm
Subject:Re: [Drizzle-discuss] Removing Array custom vector allocation for
semi-join subqueries
View as plain text  
* Jim Starkey <jstarkey@stripped> [09/03/02 23:03]:
> Monty, aside from minor issues like breaking C++ language semantics,  
> this is extremely dangerous from an engineering point of view.  The  
> problem is this: If an object is properly deleted, its destructor is  
> called.  If it is deleted with the pool, the destructor isn't called,  
> but the memory deleted anyway.

There is nothing wrong in deleting an object allocated on
mem_root. We do it all the time.

> Valgrind isn't going to notice a  
> problem, but the failure to call the destructor may leave memory subtly  
> corrupted.
> To work, it requires that the code and/or engineers track  
> which objects need to be explicitly deleted.  Unreliability comes from  
> this sort of problem where an engineer has to understand the entire  
> system to make a successful local change.
>
> If you're concerned about memory allocation/deallocation performance,  
> use a thread based memory allocator that eliminates the mutex.  You get  
> the performance you want leaving C++ semantics intact.  It will lead to  
> cleaner encapsulation, faster code, and a lower induced bug rate.

How can valgrind help notice a memory leak with a
thread-local allocator?

-- 
Thread
Removing Array custom vector allocation for semi-join subqueriesJay Pipes26 Feb
  • Re: Removing Array custom vector allocation for semi-join subqueriesKonstantin Osipov26 Feb
    • Re: Removing Array custom vector allocation for semi-join subqueriesJay Pipes26 Feb
  • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesKonstantin Osipov26 Feb
    • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesJay Pipes26 Feb
Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueriesBrian Aker26 Feb
  • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesMonty Taylor27 Feb
    • Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueriesMARK CALLAGHAN27 Feb
      • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesMonty Taylor27 Feb
        • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesKonstantin Osipov27 Feb
          • Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueriesMARK CALLAGHAN27 Feb
        • Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueriesMARK CALLAGHAN27 Feb
          • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesJim Starkey27 Feb
    • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesMichael Widenius2 Mar
      • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesJay Pipes2 Mar
      • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesJim Starkey2 Mar
        • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesKonstantin Osipov2 Mar
        • Re: [Drizzle-discuss] Removing Array custom vector allocation forsemi-join subqueriesMichael Widenius5 Mar
Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueriesBrian Aker26 Feb