On Tue, 2006-05-30 at 22:27 +0200, fons adriaensen wrote: > On Tue, May 30, 2006 at 03:10:38PM -0400, Dave Robillard wrote: > > > > 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. > > Oh, I didn't know know port types could change dynamically.
Well, they can't, but the actual port type values in the data file aren't fixed in any way - there can be any URI (string) there. The function we're talking about pulls this info directly from the data file (not eg from a loaded Port object which would have a const type string). The library doesn't load all the stuff from the file into memory (in which case the port type would be const), it just queries the data file every time you ask for something (I won't attempt to enforce my guess about what a host would want to cache in memory, that's the hosts' decision). (Rationale being that an LV2 host can run an LV2 plugin keeping only the actual DLL in memory (eg consuming far less memory than an equivalent LADSPA plug), rather than having a bunch of data sitting around that may not be useful) -DR-
