Re: g_malloc overhead



On Tue, 2009-01-20 at 09:01 +0100, Martín Vales wrote:
> BJörn Lindqvist escribió:
> > Actually, a custom allocator could be useful even in the general case.
> > Malloc is a system call and has quite bad performance on certain
> > platforms (windows in particular i think). Something like the gslice
> > allocator could
> > Probably improve performance a bit.
> >   
> gslice i believe use malloc internally. I believe you always need 
> malloc/new-(C/C++) because you depend on ms Windows API.
> 
> I am not sure if you can build your own malloc because you depend on the 
> operating system.
Sure, you must malloc to get new memory, but you can malloc bigger than
what you need and hand out the extra memory later at a much lower cost.

-Larry
<larry yrral net>


> 
> regards.
> 
> >
> > 2009/1/18, muppet <scott asofyet org>:
> >   
> >> On Jan 18, 2009, at 11:43 AM, Martín Vales wrote:
> >>
> >>     
> >>> What are the advantages of use a glib_mem_vtable ???. I think we
> >>> have the same malloc function in all operating systems?
> >>>       
> >> This vtable allows you to swap in a different allocator with next to
> >> no effort.  Maybe it has special OOM handling, or uses a special pool
> >> or allocation algorithm tuned to your use-case, or does debugging
> >> logging work, or whatever.  The fact that the default is the same
> >> everywhere is a bit beside the point of having the functionality.
> >>
> >>
> >>
> >> --
> >> Me:  What's that in your mouth?
> >> Zella:  *swallows laboriously*  Nothing.
> >> Me:  What did you just swallow?
> >> Zella:  A booger.
> >> Me:  Baby girl, don't eat boogers.  That's gross.
> >> Zella:  But it was in my nose.
> >>
> >> _______________________________________________
> >> gtk-devel-list mailing list
> >> gtk-devel-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
> >>
> >>     
> >
> >
> >   
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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