[gst-devel] use of g_alloca

Stefan Kost ensonic at hora-obscura.de
Sun Sep 11 07:25:30 CEST 2005


hi all,

what is the problem with using g_alloca() [1][2]? The advantages are clear. In 
processing function the use of g_alloca for temporary data blocks is better as 
it is really fast and cannot leak.
I there  know plattform where it does not work? If so why aren't we use the cpp 
to use g_malloc then? e.g.

#ifdef HAVE_G_ALLOC_A
#define gst_alloca(size) g_alloca(size)
#define gst_freea(mem)
#else
#define gst_alloca(size) g_malloc(size)
#define gst_freea(mem) g_free(mem)
#endif

Stefan

[1] 
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.357.2.6&r2=1.357.2.7
[2] 
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/audioconvert/gstchannelmix.c.diff?r1=1.6.2.5&r2=1.6.2.6






More information about the gstreamer-devel mailing list