unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Lisp_Marker size on 32bit systems
Date: Fri, 07 Sep 2018 17:19:21 +0300	[thread overview]
Message-ID: <831sa5v192.fsf@gnu.org> (raw)
In-Reply-To: <b078491f-5d6f-68c8-b70d-41537a37f463@cs.ucla.edu> (message from Paul Eggert on Fri, 7 Sep 2018 06:45:48 -0700)

> Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 7 Sep 2018 06:45:48 -0700
> 
> >    In file included from lisp.h:35:0,
> > 		   from window.c:25:
> >    ../lib/verify.h:207:21: error: static assertion failed: "verify (header_size == sizeof (union vectorlike_header))"
> 
> It works for me in that configuration in Fedora 28. I get the following values; 
> what do you get?
> 
> sizeof (ptrdiff_t) = 4
> sizeof (union vectorlike_header) = 4
> offsetof (struct Lisp_Vector, contents) = 4
> offsetof (struct Lisp_Sub_Char_Table, depth) == 4
> offsetof (struct Lisp_Sub_Char_Table, contents) == 12

I obtained the below by building Emacs after commenting out the
offending 'verify':

  (gdb) ptype union vectorlike_header
  type = union vectorlike_header {
      ptrdiff_t size;
  }
  (gdb) p sizeof(union vectorlike_header)
  $3 = 4
  (gdb) ptype /o struct Lisp_Vector
  /* offset    |  size */  type = struct Lisp_Vector {
  /*    0      |     4 */    union vectorlike_header {
  /*                 4 */        ptrdiff_t size;

				 /* total size (bytes):    4 */
			     } header;
  /* XXX  4-byte hole  */
  /*    8      |     0 */    Lisp_Object contents[];

			     /* total size (bytes):    8 */
			   }
  (gdb) p sizeof(ptrdiff_t)
  $4 = 4
  (gdb) ptype /o struct Lisp_Sub_Char_Table
  /* offset    |  size */  type = struct Lisp_Sub_Char_Table {
  /*    0      |     4 */    union vectorlike_header {
  /*                 4 */        ptrdiff_t size;

				 /* total size (bytes):    4 */
			     } header;
  /*    4      |     4 */    int depth;
  /*    8      |     4 */    int min_char;
  /* XXX  4-byte hole  */
  /*   16      |     0 */    Lisp_Object contents[];

			     /* total size (bytes):   16 */
			   }

I think GCC aligns the Lisp_Object array within the structures because
a Lisp_Object is an 8-byte data type in this configuration.



  parent reply	other threads:[~2018-09-07 14:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  0:41 Lisp_Marker size on 32bit systems Stefan Monnier
2018-09-06  6:51 ` Paul Eggert
2018-09-06 12:17   ` Stefan Monnier
2018-09-07  7:15     ` Paul Eggert
2018-09-07  8:05       ` Eli Zaretskii
2018-09-07 13:45         ` Paul Eggert
2018-09-07 14:12           ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Stefan Monnier
2018-09-07 14:23             ` Eli Zaretskii
2018-09-07 15:16             ` GDB and compiler-operations Andreas Schwab
2018-09-07 15:48             ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Paul Eggert
2018-09-07 15:58               ` GDB and compiler-operations Stefan Monnier
2018-09-07 17:11                 ` Eli Zaretskii
2018-09-07 17:15                 ` Paul Eggert
2018-09-07 19:59             ` Tom Tromey
2018-09-07 14:19           ` Eli Zaretskii [this message]
2018-09-07 16:27             ` Lisp_Marker size on 32bit systems Paul Eggert
2018-09-07 17:16               ` Eli Zaretskii
2018-09-07 18:13                 ` Paul Eggert
2018-09-07 18:32                   ` Eli Zaretskii
2018-09-07 19:05                     ` Paul Eggert
2018-09-07 19:22                       ` Eli Zaretskii
2018-09-07 12:16       ` Stefan Monnier
2018-09-07 19:04         ` Paul Eggert
2018-09-07 19:45           ` Stefan Monnier
2018-09-07 21:03             ` Paul Eggert
2018-09-08  1:54               ` Stefan Monnier
2018-09-08  3:04                 ` Paul Eggert
2018-09-08  3:10                   ` Stefan Monnier

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=831sa5v192.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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).