From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56371 invoked by alias); 9 Nov 2015 07:39:42 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 56340 invoked by uid 89); 9 Nov 2015 07:39:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Nov 2015 07:39:41 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D69733DD42; Mon, 9 Nov 2015 07:39:39 +0000 (UTC) Received: from bigtime.twiddle.net (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA97dbIQ032624; Mon, 9 Nov 2015 02:39:38 -0500 Subject: Re: documentation patch, oddities, and proposals To: Tom Tromey References: <87d1vqe3e0.fsf@tromey.com> <5639B430.2010807@redhat.com> <87wpttd47v.fsf@tromey.com> Cc: libffi-discuss From: Richard Henderson Message-ID: <56404DB8.9040309@redhat.com> Date: Mon, 09 Nov 2015 07:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87wpttd47v.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015/txt/msg00096.txt.bz2 On 11/07/2015 08:00 PM, Tom Tromey wrote: > rth> Indeed. It would be very nice to require a separate layout call, > rth> rather than imply it from ffi_prep_cif. This would also nicely fix > rth> the problem that libgo encountered wrt zero-sized structures. > > What was that problem btw? If it's something users might encounter I > could update the docs to account for it. The fact that size 0 is the trigger that the structure hasn't been layed out. So every call to such a function re-enters the layout for a zero-sized struct. In the end it still works, but there's more overhead than needed. r~