unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>, emacs-devel@gnu.org
Subject: Re: Alignment of Lisp_Subr
Date: Fri, 14 Nov 2003 01:18:25 +0900	[thread overview]
Message-ID: <87llqkgs32.fsf@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <20031112233013.GB27000@fencepost> (Miles Bader's message of "Wed, 12 Nov 2003 18:30:13 -0500")

>>>>> "Miles" == Miles Bader <miles@gnu.org> 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 <martin@xemacs.org>.  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.

  reply	other threads:[~2003-11-13 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12 16:22 Alignment of Lisp_Subr Stefan Monnier
2003-11-12 23:30 ` Miles Bader
2003-11-13 16:18   ` Stephen J. Turnbull [this message]
2003-11-14  5:23     ` Gaute B Strokkenes
2003-11-14 11:28       ` Stephen J. Turnbull
2003-11-16 10:25         ` Gaute B Strokkenes
2003-11-13  2:40 ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87llqkgs32.fsf@tleepslib.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).