From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Alignment of Lisp_Subr Date: Wed, 12 Nov 2003 21:40:22 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1068692124 9249 80.91.224.253 (13 Nov 2003 02:55:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2003 02:55:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Nov 13 03:55:22 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 1AK7di-00012n-00 for ; Thu, 13 Nov 2003 03:55:22 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AK7dh-0008Oe-00 for ; Thu, 13 Nov 2003 03:55:21 +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 1AK8Xq-0002y4-2G for emacs-devel@quimby.gnus.org; Wed, 12 Nov 2003 22:53:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AK8We-0002ma-2e for emacs-devel@gnu.org; Wed, 12 Nov 2003 22:52:08 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AK8Td-0001p8-4u for emacs-devel@gnu.org; Wed, 12 Nov 2003 22:49:33 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AK8Tc-0001ot-NW for emacs-devel@gnu.org; Wed, 12 Nov 2003 22:49:00 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1AK7PC-0001dq-PS; Wed, 12 Nov 2003 21:40:22 -0500 Original-To: Stefan Monnier In-reply-to: (message from Stefan Monnier on 12 Nov 2003 11:22:33 -0500) 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:17790 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17790 - 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. The only alternative I can think of is to add a padding field to Lisp_Subr and when its address is not a multiple of 8, memmove it by a few bytes (I think `defsubr' is the only place where we refer to these statically allocated Sfoo variables). Any comment on which approach is preferable ? Subr objects are allocated statically, but I don't think anything requires that. There is no harm in copying the data to some new, properly-aligned block of memory and using that block instead.