unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Lisp_Marker size on 32bit systems
@ 2018-09-06  0:41 Stefan Monnier
  2018-09-06  6:51 ` Paul Eggert
  0 siblings, 1 reply; 28+ messages in thread
From: Stefan Monnier @ 2018-09-06  0:41 UTC (permalink / raw)
  To: emacs-devel


The new Lisp_Marker is larger than the old one on 32bit systems:

    sizeof (struct Lisp_Marker)

used to be 24 (bytes) when we used Lisp_Misc, but it is now 32 (bytes) instead!

The reason seems to be that the vectorlike_header (which contains just
a simple int) occupies 8 bytes!
So those 8 bytes, plus 20 bytes of actual real data leads to 28bytes
which are rounded up to 32 for alignment purposes.

Why does vectorlike_header occupy 8bytes?  Because we use

    union vectorlike_header
      {
        ptrdiff_t size;
        /* Align the union so that there is no padding after it.  */
        Lisp_Object align;
        GCALIGNED_UNION
      };

where GCALIGNED_UNION forces alignment on a multiple of 8 and hence
a minimum size of 8 as well.

So, on 32bit hosts, our vectorlike_header carries 4bytes of useful info
but occupies 8bytes anyway.

This sucks.

This misfeature was introduced by the following commit:

    commit b1573a97e17b518723ab3f906eb6d521caed196d
    Author: Paul Eggert <eggert@cs.ucla.edu>
    Date:   Mon Nov 13 08:51:41 2017 -0800

        Use alignas to fix GCALIGN-related bugs

Could we get this fixed, to reduce the overhead of our vectors on 32bit
hosts (including bringing back Lisp_Marker back to 24 bytes)?


        Stefan



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2018-09-08  3:10 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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           ` Lisp_Marker size on 32bit systems Eli Zaretskii
2018-09-07 16:27             ` 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

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