Re: [patch] calling g_malloc & co via a vtable



On 4 Oct 2000, Havoc Pennington wrote:

> > * rip out the memory profiler/checker (Can be done using a vtable)
> 
> Or better, put in a more useful profiler (well, it will already be
> more useful if you don't have to rebuild glib to use it...)

I'm all for removing all the #ifdefs in the current memory profiler code
and do all kinds of thorough checking in a specific debugging
allocator. This can even be placed in a separate file for easy removal in
tight situations.
  
> > And, optionally, if the maintainers think it's suitable:
> > * Add a memory pressure callback. With suitable comments in the code 
> >   explaining the problems this can cause if used improperly ("Here be
> >   dragons")
> 
> I don't think you can have a generic one (people have to keep up with
> their own list of stuff they can free). Or if you mean just a function
> to be called by the default malloc(), I think it's better to just let
> people replace the default malloc.

I was thinking more of a list of callbacks that the default g_malloc
called when malloc returns NULL, but i'm comfortable with not having this
at all.

/ Alex





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]