Re: FCP FxPlug load order - how do I control?
Re: FCP FxPlug load order - how do I control?
- Subject: Re: FCP FxPlug load order - how do I control?
- From: Paul Schneider <email@hidden>
- Date: Thu, 26 Jun 2008 13:59:17 -0400
Hi Pierre,
I keep hearing it's an Objective C issue with dynamic libraries.
That does not sound right to me.
The Objective-C runtime maintains a flat registry of all the classes
defined in a process. It currently makes no distinction as to which
library implements the classes.
Classes are added to the registry the first time they are used. So
for example, if your plugin calls:
[[MyFunClass alloc] init];
"MyFunClass" is now loaded into the global application namespace. Any
code anywhere in the application can now use MyFunClass.
If another library has already defined a "MyFunClass" class, then your
plugin will end up using that class instead.
C and C++ symbols can be restricted to individual libraries with the
appropriate compiler switches, as Pete so helpfully pointed out. Obj-
C classes are different; since they are not resolved at link time, but
at run time, the compiler can't help you. The language's runtime
would have to be modified to support per-library namespaces.
Otherwise isn't there a risk (aside secutiry) if symbols get loaded
in global space, that I name a function the same as you and
inadvertently override it in the exec.
Yes, this is a concern. Many Objective-C mavens would consider this a
feature; you are free to extend or modify all classes, even those you
didn't write. It's an intriguing feature in a modular application; it
can cause trouble in an app that can load an arbitrary number of third-
party plugins that come from various vendors and source bases.
- Paul
On Jun 26, 2008, at 1:27 PM, Pierre Jasmin wrote:
Side Note:
I keep hearing it's an Objective C issue with dynamic libraries.
That does not sound right to me.
Since I know nothing about ObjectiveC (could not even develop a
stand-alone to test what I am saying), can I ask if it isn't the
issue itself in Apple implementation of dlopen (or whatever you use
to load) - OR simply the arguments passed to dlopen? Don't you just
dlsym() the entry points of the API (RTLD_LOCAL or something)?
Otherwise isn't there a risk (aside secutiry) if symbols get loaded
in global space, that I name a function the same as you and
inadvertently override it in the exec.
Pierre
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden