| List: | Internals | « Previous MessageNext Message » | |
| From: | MARK CALLAGHAN | Date: | February 27 2009 2:15pm |
| Subject: | Re: [Drizzle-discuss] Removing Array custom vector allocation for semi-join subqueries | ||
| View as plain text | |||
On Thu, Feb 26, 2009 at 11:17 PM, Monty Taylor <mordred@stripped> wrote: > Therefore, I'm going to say that what we _really_ want instead of > mem_root is what Jay and I have been pushing for for a while - resource > management through ownership. Pointers to allocated memory should be > contained in, owned by and managed by an object, such that when the > object goes away, so does the memory. It's almost like magic how much a > nice containment hierarchy can achieve the end-goal of mem_root. > > I'd post a code sample... but I'm falling asleep sitting here... I'll > come back to this in the morning. :) > > Monty > I am curious about how this will deal with the problem of memory allocations that have different lifetimes. The popular ones in non-drizzled MySQL are: * global -- get it from malloc() today * per connection -- get it from the THDs mem_root today * per session -- not sure if it exists today * custom -- not sure if it exists today Having more than one lifetime is already a problem as you need to be very careful when maintaining a pointer to an object that has a shorter lifetime (objects from the global allocation can't point to per-session, ...). -- Mark Callaghan mdcallag@stripped
