public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "Kaz Kylheku (libffi)" <382-725-6798@kylheku.com>
Cc: Martin Uecker <ma.uecker@gmail.com>,
	 Martin Uecker via Libffi-discuss <libffi-discuss@sourceware.org>
Subject: Re: wide function pointer type
Date: Thu, 21 Oct 2021 11:48:26 +0200	[thread overview]
Message-ID: <87zgr2so7p.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <f32f2f810d519fd3d544c30ff10860d2@mail.kylheku.com> (Kaz Kylheku's message of "Wed, 20 Oct 2021 10:27:45 -0700")

* Kaz Kylheku:

> On 2021-10-20 02:10, Florian Weimer via Libffi-discuss wrote:
>> Perhaps a set of standard attributes to describe the explicit closure
>> argument would be useful, though.
>
> For what purpose though? If there is some attribute mechanism in the
> syntax, what translation decision does it drive? Or else, what
> diagnostic purpose?

Auto-generation of bindings for languages that have functions with
environments.

> If the compiler knows that some closure argument c is linked with a
> function f, what special treatment can it perform?

It can automatically separate the environment/chain pointer from the
code pointer and pass them in the right arguments.  And a thunk can be
create if necessary.

> The annotation mechanism would have to be propagated to all the
> places in the program where the f value can reach; which means
> additional declaration material in multiple places. If a structure
> stores a function pointer and context value, we need to be able
> to relate them in a structure, and so forth.

Environment/chain arguments in structs would only need annotating if
they are publicly exposed on API boundaries.  I am not convinced this is
a common occurrence.

With the new function pointer type, all these types have to be
duplicated, to preserve compatibility with older C versions.  That seems
rather unlikely.

Thanks,
Florian


  reply	other threads:[~2021-10-21  9:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 11:32 Martin Uecker
2021-10-17 23:35 ` Anthony Green
2021-10-18  5:33   ` Martin Uecker
2021-10-18  5:58     ` Martin Uecker
2021-10-18  7:36       ` Florian Weimer
2021-10-18  7:56         ` Martin Uecker
2021-10-19  9:22           ` Florian Weimer
2021-10-19  9:43             ` Martin Uecker
2021-10-19 10:15               ` Florian Weimer
2021-10-19 12:13                 ` Martin Uecker
2021-10-20  8:24                   ` Kaz Kylheku (libffi)
2021-10-20 18:52                     ` Martin Uecker
2021-10-20  9:10                   ` Florian Weimer
2021-10-20  9:21                     ` Martin Uecker
2021-10-20  9:27                       ` Florian Weimer
2021-10-20 17:27                     ` Kaz Kylheku (libffi)
2021-10-21  9:48                       ` Florian Weimer [this message]
2021-10-10 17:01 Kaz Kylheku (libffi)
2021-10-10 17:44 ` Martin Uecker
2021-10-10 17:49   ` Daniel Colascione
2021-10-10 18:05     ` Martin Uecker
2021-10-10 18:17       ` Daniel Colascione
2021-10-10 18:47         ` Martin Uecker
2021-10-10 18:57           ` Daniel Colascione
2021-10-10 19:24             ` Martin Uecker
2021-10-16  8:08               ` Jarkko Hietaniemi
2021-10-16  9:35                 ` Jarkko Hietaniemi
2021-10-10 18:31   ` Kaz Kylheku (libffi)

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=87zgr2so7p.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=382-725-6798@kylheku.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=ma.uecker@gmail.com \
    /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).