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

From: Dave Robillard <drobilla@email-addr-hidden>
Date: Tue May 30 2006 - 22:10:38 EEST

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-
Received on Wed May 31 04:15:04 2006

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