Re: ORBit2 issues (was Re: ORBit 0.5.15 any problem?)
- From: Huw Rogers <count0 metavector com>
- To: Michael Meeks <michael ximian com>, orbit <orbit-list gnome org>
- Subject: Re: ORBit2 issues (was Re: ORBit 0.5.15 any problem?)
- Date: Tue, 28 May 2002 02:21:02 +0900
> On Mon, 2002-05-27 at 14:48, Huw Rogers wrote:
> > In ORBit2, revisions 1.31/1.32 of corba-typecode.c
> > and revision 1.14 of corba-typecode.h created this problem by redefining
> > the sublabels[] array of a union as an array of CORBA_long (32bits) (was
> > previously an array of CORBA_any).
>
> Yes - and it really, really sucked for performance.
>
> > cvs -z3 diff -r1.13 -r1.14 corba-typecode.h
> >
> > a CORBA_long is insufficient to hold a CORBA_long_long or a
> > CORBA_unsigned_long_long discriminator value.
> >
> > So if the union discriminator is >32 bits,
>
> So you want to have > 4bn^2 elements in your union ? or you want to do
> some really, really funky binary stuff on the wire - of highly dubious
> merit.
>
> > and one of the cases of the union is a >32bit constant (one of the
> > sublabels), then there will be a problem.
>
> Why would you possibly, ever, ever want that ?
>
> > union u switch(unsigned long long) {
> > case 0x0000000000000001: string s;
> > case 0x0000000100000001: short h;
>
> I take your point that this won't work - why would you possibly want it
> to ? why would you want to pay the horrible cost of storing the
> enumeration as an any ? why pay the space penalty of a 64 bit number,
> and the time penalty of a 64 bit compare, when this case is never going
> to occur ?
>
> Quite why that was ever introduced into the spec is a total mystery to
> me.
Well it's in the spec, unfortunately, although I agree that my example
is perverse.
I would propose that sublabels be a void *, and that sublabels[i] be
the actual discriminator type rather than CORBA_long. I.e. no more
casting. That might actually be more efficient overall.
-Huw
--
Huw Rogers <count0@metavector.com>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]