Re: Memory allocation: abort on failure?



W. Borgert wrote:
Hi,

on the Ethereal mailing list is a discussion on how to get rid of
glib in Ethereal
(http://www.ethereal.com/lists/ethereal-dev/200509/msg00027.html).
An explanation on why people don't like glib is given by Guy Harris
(http://www.ethereal.com/lists/ethereal-dev/200509/msg00032.html).
Note, that Ethereal currently can be build with either Gtk+1/glib1
or Gtk+2/glib2, as some platforms seem to have problems with
Gtk+2/glib2.  Could someone explain, whether the problem exists
with current glib versions?

Cheers, W. Borgert

Hello,

To answer http://www.ethereal.com/lists/ethereal-dev/200509/msg00027.html :
It is certainly sound to have as few dependencies as possible in a project, as long as this does not imply reinventing the wheel, but if Ethereal people did not know that, they probably wouldn't have acheived such a nice piece of software :-)

To answer http://www.ethereal.com/lists/ethereal-dev/200509/msg00032.html :
Since glib 2.8 there is a g_try_{malloc,malloc0,realloc} familly of functions that may be used. Moreover, remember that (at least since glib 2.0) the memory management function of the glib you are using are provided as default that can be overriden at your convenience using the g_mem_set_vtable function, plsease refere to http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Allocation.html#g-mem-set-vtable for more information.

Cheers,

Sylvain



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