[linux-audio-dev] LV2 library API

Dave Robillard drobilla at connect.carleton.ca
Tue May 30 19:10:38 UTC 2006


On Tue, 2006-05-30 at 19:38 +0200, fons adriaensen wrote:
> 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 *.

It's not a constant.

-DR-





More information about the Linux-audio-dev mailing list