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: struct by value copies



On Sep 2, 2008, at 2:22 PM, Thomas Heller wrote:


Timothy Wall schrieb:
I'm wondering if the responsibility of making a copy of struct by
value arguments lies with the caller of ffi_call or with libffi.

I've been looking through different targets to see if this is done
anywhere, and don't see copies made anywhere, so I would guess
responsibility lies with the caller of ffi_call.

Anyone know for sure?

Are you asking in the context of your win64 port? I do not know the answer but I suspect that ffi_call makes the copy itself.

Yes, this is the context.




In my Python win64 libffi implementation there is still the bug that these
copies are not made (for structures that do not fit into a register)
although I have never seen this bug on other platforms.

I'll check on X86_WIN32 when I clean this stuff up.




I did not yet have the time to debug or fix this problem.

I'll post the patches when I'm done. I've got a solution which does the right thing, assuming that it is the responsibility of ffi_call to allocate the copies.


BTW, I started from your port, thank you very much :)

T.


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