public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "John E. Malmberg" <wb8tyw@qsl.net>
To: libffi-discuss@sourceware.org
Subject: src/alpha/ffitarget.h  - FFI_TRAMPOLINE_SIZE
Date: Thu, 16 Apr 2015 03:22:00 -0000	[thread overview]
Message-ID: <mgn9sa$lom$1@ger.gmane.org> (raw)

I do not have a Tru64 system to test this on.

Looking at the code in src/alpha/ffitarget.h and src/alpha/ffi.c, 
something does not look right.

FFI_TRAMPOLINE_SIZE is set to 24 in ffitarget.h

The typedef struct ffi_closure is then set up in ffi.h as:

typedef struct {
   char tramp{FFI_TRAMPOLINE_SIZE];
   ffi_cif * cif;
   void (*fun)...
   void *user_data
} ffi_closure

In ffi.c ffi_prep_closure_loc(), the code then does:

   tramp = (unsigned int *) &closure->tramp[0];
   ....

    *(void **) &tramp[4] = ffi_closure_osf;

But tramp only has 3 longword members per the previous declaration, so 
&tramp[4] is the address of the '*cif' member of the structure which is 
then updated:

    closure->cif = cif;

Am I understanding this correctly?

Regards,
-John




             reply	other threads:[~2015-04-16  3:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  3:22 John E. Malmberg [this message]
2015-04-16 10:58 ` Jarkko Hietaniemi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='mgn9sa$lom$1@ger.gmane.org' \
    --to=wb8tyw@qsl.net \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).