This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: does it matter how I construct an aggregate struct type if its size is the same?


Still beware of alignment.

 - Jay

On Dec 18, 2015, at 12:04 PM, Andrew Haley <aph@redhat.com> wrote:

> On 18/12/15 15:16, Hayden Livingston wrote:
>> Thanks, Andrew. Where is this exception? In ABIs?
>> 
>> So you're suggesting I use char's to construct my ffi_types?
> 
> Well, it can be awkward.  Some targets pass the components of a
> struct in registers.  But this only matters if you pass a struct
> by value, which is a fairly unusual thing to do in C.  If you're
> passing a struct by reference, then yes, you can just create a
> char array of the right size.
> 
> Andrew.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]