Re: BonoboUnknown & G_SIGNAL_TYPE_STATIC_SCOPE
- From: Owen Taylor <otaylor redhat com>
- To: Michael Meeks <michael ximian com>
- Cc: Havoc Pennington <hp redhat com>, Jens Finke <jens triq net>, bonobo <gnome-components-list gnome org>, Tim Janik <timj gtk org>
- Subject: Re: BonoboUnknown & G_SIGNAL_TYPE_STATIC_SCOPE
- Date: 02 Jan 2002 15:41:56 -0500
Michael Meeks <michael ximian com> writes:
> Hi Havoc,
>
> On Wed, 2002-01-02 at 17:37, Havoc Pennington wrote:
> > Jens Finke <jens triq net> writes:
> > > #define BONOBO_TYPE_UNKNOWN
> > > (bonobo_unknown_get_type () | G_SIGNAL_TYPE_STATIC_SCOPE)
> >
> > I don't think this works at all; there will be cases where the static
> > scope isn't expected or allowed when you do want the type.
>
> Such as this indeed - return values; where the value is just passed
> back by the signal mechanism ( I hope - there is no need for a copy here
> => the static flag is somewhat irrelevant, hence the assertion (?) ).
I have to agree with Havoc that this is an inappropriate usage.
You are only allowed to use G_SIGNAL_TYPE_STATIC_SCOPE for
signal arguments, so including it in the type macro is going
to cause people very unexpected problems.
> > > - BONOBO_TYPE_UNKNOWN,
> > > + bonobo_unknown_get_type (),
> >
> > The standard convention is that the get_type() function should never
> > be used directly, the macro should always be used.
>
> The problem is (AFAIR) that there is a plague of copying going on in
> the signal mechanism - and that if applied to frequently emitted
> signal's arguments - with remote Bonobo_Unknowns ( which are plain CORBA
> references ) we spew redundant CORBA traffic. Thus in most real cases
> the static scope is going to help people do the right thing.
Sheesh, can't we add a bit of magic / evil C API so that Bonobo_Unknown_ref()
only holds one reference to the remote object for all local references?
This doesn't seem like the only place people are going to get bitten.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]