From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS image cache Date: Sun, 05 May 2024 17:07:17 +0300 Message-ID: <861q6ge4iy.fsf@gnu.org> References: <875xvvp3fo.fsf@gmail.com> <87o79n0wna.fsf@gmail.com> <86ikzseipz.fsf@gnu.org> <86bk5keev3.fsf@gnu.org> <867cg8ed56.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 05 16:08:35 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3cXb-000AaC-KN for ged-emacs-devel@m.gmane-mx.org; Sun, 05 May 2024 16:08:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3cWe-0006pf-Ht; Sun, 05 May 2024 10:07:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3cWS-0006VB-Pn for emacs-devel@gnu.org; Sun, 05 May 2024 10:07:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3cWR-0008LC-Ep; Sun, 05 May 2024 10:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Smz/xYJlcWrHe+zkK0QzwiXNFX/OROS8HubXCr0BcfM=; b=jknzFGOyMaR3TurRCAFQ 3RP/fNl+aVNZMVzOKlqXTj0maIQmldHc7DPxU4OJAfYqVG+Kfp/YT3ytIHAtrpiaVni2kG+4R0KkB Qcv+DrBXH/BUOEFb4JWyNxjleRPEbw0/VCUn6ywfLo26tTtW9UuNolfNGOnl84i8EIU4GD9pgCCNU 0KjFL4f/YzhS+fsVwYOyFw9xKGs0nMgNmHAdWAUW7dtY4GUBrOfxkV+a4a36bGr5AUTzNNBAkiako vtDaw/gDCy6zdI3Oc5WJRGrNRqCoc2XL8dJoi2fd79AY7rawz1lMcVMA4zh921dHoCMnNb8ydV+0i wN8uZF3koeYWbg==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Sun, 05 May 2024 14:55:04 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318826 Archived-At: > From: Gerd Möllmann > Cc: eller.helmut@gmail.com, emacs-devel@gnu.org > Date: Sun, 05 May 2024 14:55:04 +0200 > > Eli Zaretskii writes: > > >> It is on my platform. > > > > IME, this cannot be relied upon, unless we explicitly tell the > > compiler to pack (using some pragma or somesuch). > > And the static_assert will fire, right. You're telling me nothing new, > BTW. I'm pretty well acquainged with all this. I imagined, it just took me by surprise that you would nonetheless write code that could so easily fail to compile. > >> We allocate a vector of N pointers. The N is found in the header when we > >> scan it. It's the size of the MPS object we scan minus the header > >> divided by how large a pointer is. > > > > OK, but why does the struct have to fit in a single word? > > It doesn't, it the other way around. I'm using nwords - 1 for the size > of the vector, and the static_assert is intended to fire if nwords - 1 > is not right. OK, then my question now is "why does it have to be nwords-1?"