Re: g_malloc overhead



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.


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



-- 
mvh Björn



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