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: Bohdan R . Rau
Subject: [PATCH 2/2] Use GLib allocation in the audio subsystem.
Date: Tue, 05 Oct 2010 14:29:12 +0200

On Tue, 5 Oct 2010 14:04:13 +0200, Halim Sahin <halim.sahin at t-online.de>
wrote:
> Hi Hynek,
> I am fine with your opinion except one litle thing:
> Glib is a bad dependency if you don't use a whole desktop but want to
> use speechd in plain consoles.
> Building small environments will install a lot of deps when using
glib(eg.
> gtk).

Glib does not imply GTK. Good example: very popular mc - I have installed
mc on all my servers and none of them has gtk installed.
> 
> Unfortunately glib is in use on many places in the speechd code so it
> would take a lot of time to refactor these parts.

I don't agree.
We use only very small subset of glib, and there should be no problem to
write these functions from scratch, and then replace all "g_" prefixes with
"spd_" (or something).

For example:

void spd_free(void *arg)
{
    if (arg) free(arg);
}

char *spd_string_free(SPDString *string, int freestr)
{
    char *rv=freestr?NULL:string->str;
    spd_free(rv);
    spd_free(string);
    return rv;
}

It may be done with single patch. And refactoring the code may be done
with simple python (or even bash/sed) script.

Also, we can keep compatibility between our and libc functions (especially
malloc, realloc and free) to be compatible with external libraries.

Also - we can optimize these function (especially string and array
functions) for typical (in speech-dispatcher) usage...

ethanak
-- 
http://milena.polip.com/ - Pa pa, Ivonko!



reply via email to

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