Re: ALIGNOF_CORBA_* defines
- From: Michael Meeks <michael ximian com>
- To: orbit-list gnome org
- Subject: Re: ALIGNOF_CORBA_* defines
- Date: Thu, 15 Feb 2001 13:40:10 -0500 (EST)
On Thu, 15 Feb 2001, Wim Oudshoorn wrote:
> C - struct: --(1)----> Independent ------(2)--> GIOP message
> 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
> 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
] [Thread Prev