From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs-26 9e59de9: Use GCALIGNED properly for GCC Date: Fri, 10 Nov 2017 11:23:40 -0500 Message-ID: References: <20171109031206.7056.28312@vcs0.savannah.gnu.org> <20171109031208.D2CAF2033E@vcs0.savannah.gnu.org> <5A0550FE.2030703@gmx.at> <83zi7upnfo.fsf@gnu.org> <4ee60712-789e-f160-52a9-4e24a9733a11@cs.ucla.edu> <83shdmpiah.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510331047 19299 195.159.176.226 (10 Nov 2017 16:24:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2017 16:24:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 10 17:24:01 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDC64-0004gR-45 for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 17:24:00 +0100 Original-Received: from localhost ([::1]:42441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDC6B-0006yk-Cz for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 11:24:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDC5v-0006tT-VB for emacs-devel@gnu.org; Fri, 10 Nov 2017 11:23:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDC5s-0005kP-Qr for emacs-devel@gnu.org; Fri, 10 Nov 2017 11:23:51 -0500 Original-Received: from [195.159.176.226] (port=48849 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDC5s-0005ib-Jl for emacs-devel@gnu.org; Fri, 10 Nov 2017 11:23:48 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eDC5j-0003pC-5Y for emacs-devel@gnu.org; Fri, 10 Nov 2017 17:23:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+O2RZHAPpRjef0p57rUQWHVrTMI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220029 Archived-At: > union gcaligned_foo { struct foo s; int64_t gcaligned; }; Are int64_t necessarily aligned on multiples of 8 on 32bit platforms? > IOW, should we rely on alignas? There could be dragons there too, no? FWIW, for the dummy alignment thingy I wouldn't use `char` (I wouldn't be surprised to see errors in compilers when asking to align on multiples of N for objects smaller than N), so maybe #define gc_aligned(typename) \ union { typename s; int64_t alignas (GCALIGNMENT) dummy; }; I'm not super happy about the "64" in there (which hardcodes basically the value of GCALIGNMENT). Depending on how alignas can be used to impose alignment of an array, we could try: typedef char gcsized_t[GCALIGNMENT]; #define gc_aligned(typename) \ union { typename s; gcsized_t alignas (GCALIGNMENT) dummy; } but maybe getting rid of this 64 is not that important. Stefan