Re: /bzr/squid3/trunk/ r9573: SourceLayout: acl/, take 1

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 16 Mar 2009 10:49:31 -0600

On 03/15/2009 11:13 PM, Robert Collins wrote:
> On Sun, 2009-03-15 at 22:35 -0600, Alex Rousskov wrote:
>> The virtual method should be called directly or indirectly by some
>> high-level user for the approach to work. Something like name() or
>> description() may work well for this purpose because it can be called by
>> the registry on behalf of the high-level user to "describe all
>> registered things".
>>
>> Compared to self-registration code, the difference is that, in this
>> case, the code in the object file is needed by the caller because it
>> implements a virtual method. The method does not have to be declared
>> pure, but it helps with forcing classes to define it and get linked.
>> That is my understanding anyway. If there are no objections, I will
>> implement and test it.

> Unless the registry has a concordance of subclasses, I would expect this
> to fail too, because the static linker will not see any concrete types.
> It may fail with 'cannot link', but it won't know *which* concrete type
> to bring in [unless the registry has a static list - which is the whole
> thing we're trying to avoid.]
>
> --whole-archive makes sense to me (if the other scheme you try fails -
> if it works, great).
>
> I thought that name() and other methods on ACL already existed as pure
> virtual though?

I agree with your logic and you are right that we already have virtual
functions that should be used from the main program. I am guessing that
the random advice that inclusion of virtual functions will help things
was either flawed or there is some other problem we need to fix first.

One potential problem I am investigating is that convenience libraries
that are linked with executables behave differently from same
convenience libraries linked with other libraries. It might be
sufficient to just change how we use the existing convenience libraries
to solve the linkage problem. Playing with it right now...

Thanks,

Alex.
Received on Mon Mar 16 2009 - 16:49:46 MDT

This archive was generated by hypermail 2.2.0 : Tue Mar 17 2009 - 12:00:04 MDT