Re: [linux-audio-dev] LV2 library API

From: fons adriaensen <fons.adriaensen@email-addr-hidden>
Date: Tue May 30 2006 - 20:38:37 EEST

On Tue, May 30, 2006 at 06:07:15PM +0100, Steve Harris wrote:
> On Tue, May 30, 2006 at 11:43:57AM -0400, Dave Robillard wrote:

> > char* type = lv2_port_get_type(someplug, 0);
> > if (!strcmp(type, LV2_DATATYPE_FLOAT))
> > /* ... */
> > free(type);
>
> Makes sense to me. You could make the API (optionally?) take a char * to
> write the result into to avoid a lot of malloc() and free()s, but I doublt
> it's a worthwhile saving.

I'd consider any interface that just returns a constant and requires
a malloc() and a free() to do it plain broken. This data doesn't live
in kernel space, or does it ? You could just return a const char *.

-- 
FA
Follie! Follie! Delirio vano e' questo!
Received on Wed May 31 04:15:03 2006

This archive was generated by hypermail 2.1.8 : Wed May 31 2006 - 04:15:03 EEST