Re: BonoboUnknown & G_SIGNAL_TYPE_STATIC_SCOPE



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 (?) ).

> > -			       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.

> I believe the right fix is to take STATIC_SCOPE out of
> BONOBO_TYPE_UNKNOWN and put it in where it's appropriate.

	Possibly; but will people know to ? or will they just get ultra bad
(umpteen round-trip) performance and give up ?

> BONOBO_TYPE_UNKNOWN isn't going to get copied, it's an object; it will
> just get g_object_ref/unref calls if it's not static (I think).

	Sadly not - BONOBO_TYPE_OBJECT is a GObject based class; and we don't
do sillies for that - we only do it for these boxed types of our own.

	Still; the whole situation is inelegant I admit,

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]