From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Alignment of Lisp_Subr Date: Fri, 14 Nov 2003 01:18:25 +0900 Organization: The XEmacs Project Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87llqkgs32.fsf@tleepslib.sk.tsukuba.ac.jp> References: <20031112233013.GB27000@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068740583 10351 80.91.224.253 (13 Nov 2003 16:23:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2003 16:23:03 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Nov 13 17:22:58 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKKFF-0001o0-00 for ; Thu, 13 Nov 2003 17:22:57 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKKFF-0007i8-00 for ; Thu, 13 Nov 2003 17:22:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKLBu-0003mR-A5 for emacs-devel@quimby.gnus.org; Thu, 13 Nov 2003 12:23:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AKLBl-0003jn-5z for emacs-devel@gnu.org; Thu, 13 Nov 2003 12:23:25 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AKL8s-00023S-MK for emacs-devel@gnu.org; Thu, 13 Nov 2003 12:20:57 -0500 Original-Received: from [130.158.98.109] (helo=tleepslib.sk.tsukuba.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKL8K-0001ov-SL; Thu, 13 Nov 2003 12:19:53 -0500 Original-Received: from steve by tleepslib.sk.tsukuba.ac.jp with local (Exim 3.36 #1 (Debian)) id 1AKKAr-0000K7-00; Fri, 14 Nov 2003 01:18:25 +0900 Original-To: Miles Bader In-Reply-To: <20031112233013.GB27000@fencepost> (Miles Bader's message of "Wed, 12 Nov 2003 18:30:13 -0500") User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.5 (celeriac, linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17801 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17801 >>>>> "Miles" == Miles Bader writes: Miles> On Wed, Nov 12, 2003 at 11:22:33AM -0500, Stefan Monnier Miles> wrote: >> - Structures of type Lisp_Subr are statically allocated and are >> not guaranteed to be aligned on a multiple of 8. I currently >> solve this by adding __attributes__ ((__aligned__ (8))), but >> this only works for GCC AFAIK. Miles> I think the compiler will force the structure to be aligned Miles> to the strictest alignment of any component, so if you Miles> stick an field with 8-byte-alignment in there _somewhere_, Miles> the compiler should do everything for you. It should even Miles> work to put the `forcing field' in as a member of a union Miles> with another field, and simply never use the forcing field. Miles> On many platforms, `double' could be used as the type of Miles> the forcing-field, but I'm not sure how universal this is. XEmacs has a typedef and a family of macros for forcing alignment. I believe the author is Martin Buchholz . We don't need to force 8 bytes, but I'd be surprised if Martin doesn't know how to do that for a very wide variety of platforms. There may be issues with Lisp objects with tagbits at the bottom. I know XEmacs had some problems on recent glibc, which were never properly diagnosed. It's probable that this was due to excessive cleverness in optimizing space use of malloc blocks, but if you do run into weirdness (we were crashing) feel free to ping me and I'll dig up the thread. -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.