[M3devel] m3gap.... it's an alignment issue

Jay K jay.krell at cornell.edu
Fri Oct 8 21:00:14 CEST 2010


Idealized is you grow everything to LONGINT or INTEGER and sort by size,
and copy back/forth with C. There will be no padding, guaranteed.

 - Jay

----------------------------------------
> From: dragisha at m3w.org
> To: jay.krell at cornell.edu
> Date: Fri, 8 Oct 2010 20:46:56 +0200
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] m3gap.... it's an alignment issue
>
> We will always have some friction there... IMO, stricter is better, with
> maybe a pragma there... preceding variable/field name, fixing align,
> like
>
> EventKey = RECORD
> type: EventType;
> <* ALIGN 4 *> window: WindowStar;
> ...
> END;
>
> As for GCC... Does it not make alignment exception, or something, to
> reference non-aligned pointer on AMD64?
>
> Idealized structs... I didn't follow you there, probably I missed
> something earlier on list.
>
> On Fri, 2010-10-08 at 18:36 +0000, Jay K wrote:
> > I may have broken this, a while ago. I may have relaxed all the
> > alignments long ago.
> > We have very little interfacing with C now and most of that is with
> > our own C,
> > where I avoid small types.
> > We have had at least temporary problems related to our rules being
> > sort of too strict.
> > The need for -munaligned-double or such. (which reminds me I should
> > try that again).
> > Where our rules were ok but gcc's default for to align stuff more.
> > Where our layout and gcc's didn't agree.
> >
> > How bad would it be to generate or write a C layer that copies stuff
> > into "idealized" structs?
> > Where the types are all INTEGER or LONGINT or pointers.
> --
> Dragiša Durić 
>
 		 	   		  


More information about the M3devel mailing list