speechd-discuss
[Top][All Lists]
Advanced

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

libspeechd SPDVoice cleanup api


From: Trevor Saunders
Subject: libspeechd SPDVoice cleanup api
Date: Fri, 24 Oct 2014 05:01:07 -0400

On Fri, Oct 24, 2014 at 08:56:05AM +0200, Bohdan R. Rau wrote:
> W dniu 2014-10-24 07:52, Trevor Saunders napisa?(a):
> >On Thu, Oct 23, 2014 at 11:29:28PM -0600, Jeremy Whiting wrote:
> >>Hey all,
> >>
> >>The current libspeechd has api to get a list of voices for the
> >>synthesizer, but no api to safely clean up the data. The attached
> >>patch adds a new method free_spd_voices to do that. It iterates over
> >>the SPDVoice ** list freeing the strdup'ed strings and the SPDVoice
> >>structures themselves.
> >
> >makes sense.
> 
> Not for me. In this case we'll have several methods for freeing different
> lists (modules, voices, synthesis-voices etc.)

yes, and that's what happens when you right C, see e.g. freeaddrinfo and
friends.

> Why it's not possible to return these lists from spd_list_something
> functions as single memory block?

For one thing that bakes size of structs and internal data structure
choices in libspeechd into the ABI, which will make it painful to change
them in the future.  Yes, the direct member access on the structs is
already bad, but at least we can add stuff at the end.

 Also trying to use only one allocation will be painful when recieving
 the list since if you need to realloc you'll need to go through and fix
 up all of your internal pointers, and there's some related
 unpleasentness.

 Trev

> In this case we could have only one spd_free(void *) function (or even we
> could say 'result should be freed with "free").
> 
> ethanak
> -- 
> http://milena.polip.com/ - Pa pa, Ivonko!
> 
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20141024/32b6f5a1/attachment.pgp>


reply via email to

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