From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Lisp_Marker size on 32bit systems Date: Wed, 05 Sep 2018 20:41:08 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536194364 21941 195.159.176.226 (6 Sep 2018 00:39:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2018 00:39:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 06 02:39:20 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxiKO-0005c7-15 for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2018 02:39:20 +0200 Original-Received: from localhost ([::1]:58771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxiMQ-0008Bg-Fc for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2018 20:41:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxiMK-0008BP-7s for emacs-devel@gnu.org; Wed, 05 Sep 2018 20:41:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxiMG-0001Wv-Ty for emacs-devel@gnu.org; Wed, 05 Sep 2018 20:41:20 -0400 Original-Received: from pmta31.teksavvy.com ([76.10.157.38]:48409) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxiME-0001DV-7Z for emacs-devel@gnu.org; Wed, 05 Sep 2018 20:41:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EtCADKdpBb//nXSC1aHAEBAQQBAQoBA?= =?us-ascii?q?YNOgWQoiCCQFYIgmBYLE4gsITcVAQIBAQEBAQECAgJpBCSGJjoHICYYRIUjo2Q?= =?us-ascii?q?aAolrilgXggCJb4ULApJ7iGEJkBWIQyIDhXork0mBVyOBVTMaCDCDJ4FuATMaj?= =?us-ascii?q?jMjMI4BAQE?= X-IPAS-Result: =?us-ascii?q?A2EtCADKdpBb//nXSC1aHAEBAQQBAQoBAYNOgWQoiCCQFYI?= =?us-ascii?q?gmBYLE4gsITcVAQIBAQEBAQECAgJpBCSGJjoHICYYRIUjo2QaAolrilgXggCJb?= =?us-ascii?q?4ULApJ7iGEJkBWIQyIDhXork0mBVyOBVTMaCDCDJ4FuATMajjMjMI4BAQE?= X-IronPort-AV: E=Sophos;i="5.53,334,1531800000"; d="scan'208";a="44948170" Original-Received: from unknown (HELO fmsmemgm.homelinux.net) ([45.72.215.249]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2018 20:41:09 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DCA72AE251; Wed, 5 Sep 2018 20:41:08 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.38 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229320 Archived-At: 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 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