speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 2/2] Use GLib allocation in the audio subsystem.


From: Christopher Brannon
Subject: [PATCH 2/2] Use GLib allocation in the audio subsystem.
Date: Sat, 02 Oct 2010 16:47:14 -0500

Boris Dusek <dusek at brailcom.org> writes:

> To summarize, my opinion is that this creates a dependency on GLib (which is a
> big one) without much gain. Tiny things should better be implemented in
> libcommon (like spd_getline). Only for the big things should we really use
> GLib (e.g. like GSettings, if we want to use them in the future). I am
> happy to help with these (e.g. aborting spd_malloc).

That makes sense.
The main reason I settled on GLib is that we're already using it in much
of the code.  Several of the modules link against it for GHashTable,
GList, and the like, as does the server.
We use GString pretty frequently for accumulating text.
To see an example of this pattern, have a look at the do_list_voices
function, from module_utils.c.
If we prefer malloc and free, we should probably implement
something similar to GString.  Also, we'll want a printf-style function
which writes to a dynamically allocated string.  See g_strdup_printf.
It is used extensively.  asprintf would seem to fit the bill, but it
isn't portable.  I'd vote for borrowing somebody else's implementation.
GLib is mostly for convenience, in these cases.

Thanks,
-- Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20101002/b7868c07/attachment-0001.pgp>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]