Subject: Re: [linux-audio-dev] Real time plug ins
From: David Olofson (david_AT_gardena.net)
Date: Fri Mar 17 2000 - 21:42:11 EST
On Thu, 16 Mar 2000, Paul Barton-Davis wrote:
> >Dynamic allocation is required for instantiation. That is, special
> >host calls will be needed to replace the standard ones. Now, is the
> >host supposed to do this by hiding malloc() etc from the plugin when
> >it's loaded, or should we use functions with other names? (I'm still
> >not convinced that loader tricks are the way to go.)
>
> This is one of the reasons why I am a C++ fan. Consider how nice it is
> to be able to say:
>
> class Plugin {
> .
> .
> protected:
> void *malloc ();
> .
> .
> };
>
> class MyPlugin : public Plugin {
> MyPlugin () {
> foo = malloc (...);
> }
> .
> .
>
> private:
> void *foo;
> .
> .
> };
>
> Voila - if all plugins were derived from Plugin, we'd instantly have
> control over all this stuff.
Indeed, this is a lot nicer than using other names, but still, the
only technical difference is that this ends up in a different way of
calling a host function. Actually, just using a different name
results in the loader setting all references directly to the target
function address when loading the plugin, so there will be no extra
runtime indirections or anything.
It does require a loader trick to get the custom names to link
directly to the normal malloc()/free()/... (without an intermediate
func in the host, that is), but OTOH, if you're using those, you're
not dealing with real time instantiation anyway.
//David
.- M u C o S --------------------------------. .- David Olofson ------.
| A Free/Open Multimedia | | Audio Hacker |
| Plugin and Integration Standard | | Linux Advocate |
`------------> http://www.linuxdj.com/mucos -' | Open Source Advocate |
.- A u d i a l i t y ------------------------. | Singer |
| Rock Solid Low Latency Signal Processing | | Songwriter |
`---> http://www.angelfire.com/or/audiality -' `-> david_AT_linuxdj.com -'
This archive was generated by hypermail 2b28 : Sat Mar 18 2000 - 07:01:06 EST