Re: ALIGNOF_CORBA_* defines

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
> 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
        It should have no bearing on GIOP alignment.
>       However the demarshalling code
>       uses ALING_ADRESS on the pointer _ORBIT_curptr,
>       which does not align with respect to the
>       GIOPMessage, but aligns the absolute adress.
        The assumption is that the buffers are both allocated spaces and
are system aligned at both pack and unpack time, consequently aligning the
absolute address, instead of some offset will give the right result.
        The system has to return maximaly aligned memory from malloc /
alloca since otherwise double *p = malloc (sizeof (double) * 8); will do
strange things eg.

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

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