help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] CStruct ABI and packed structs


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] CStruct ABI and packed structs
Date: Sun, 06 Jun 2010 19:23:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4

On 06/06/2010 04:48 AM, Holger Hans Peter Freyther wrote:
Hi again,

I had some time to browse through the CStruct code and I think it is
really nice. There are two issues for my intended usecase and I wanted
to ask what to do about it.

1.) The alignment rules of the type are inside the type itself, but in
general this is coming from the ABI. E.g. one case (it might not apply
to smalltalk) is that 64 bit types have a 8 byte alignment on ARM EABI
and 4 byte on the old ABI...

2.) The structs I showed are all packed and should not follow the
alignment rules...


I would like to move the alignof out of the type classes and into an ABI
class and at first step contain the alignment rules we have right now,
the second thing would be to create a CPackedStruct subclass which will
ignore the alignment rules. I would change the CStruct to make
subclassing more easy.

does this make sense?

Replying to this more extensively. The abstract class you're looking for is probably already there -- CCompound.

I'll look into making a primitive for unaligned accesses. Right now I prefer to stick to bugfixes only for the git repository (and I would like to have all 3.2.x images run on 3.2.y, so no new primitives), but I can queue it for 3.3.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]