Re: ALIGNOF_CORBA_* defines



You wrote:
> Hi Wim,
>
> On Thu, 15 Feb 2001, Wim Oudshoorn wrote:
> > Marshalling
> > ------------
> > C - struct:      --(1)---->  Independent  ------(2)-->  GIOP message
> > representation.
> > e.g:
> > {
> > char a;                  a char `a'                 GIOP message
> > double b;                and a double `b'           laying out the
> > }                                                     struct.
> >
> >
> > The ALIGNOF_CORBA_* are only used in step (1).
> > And a different set of ALIGNMENT numbers, namely the
> > GIOP specification alignment, is used for step (2).
>
> Sort of, however there is no clear separation between these steps,
> the Independent representation is just a way of addressing the C structure
> layout.

The representation above was just a conceptual distinction between
the two steps,  I did not think that this was actual the way it happened.


> > A)
> > The function
> >
> > static guint8
> > oidl_get_tree_alignment (IDL_tree tree)
>
> This function ( and indeed what it produces: the
> arch_head/tail_align are only used to determine whether the C packing of
> the structure is tight and thus whether we can start doing more efficient
> things with coalescing; see orbit-idl-passes.c
> (oidl_pass_set_coalescibility_2).
>
> It should have no bearing on GIOP alignment.

I will look at it deeper.


> The system has to return maximaly aligned memory from malloc /
> alloca since otherwise double *p = malloc (sizeof (double) * 8); will do
> strange things eg.

So that is the problem.  At my machine they are aligned at 4 byte boundaries.

Wim Oudshoorn.




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