From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS image cache Date: Sun, 05 May 2024 11:31:23 +0200 Message-ID: References: <875xvvp3fo.fsf@gmail.com> <87o79n0wna.fsf@gmail.com> <86ikzseipz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38255"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 05 11:32:27 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 1s3YEM-0009mZ-TS for ged-emacs-devel@m.gmane-mx.org; Sun, 05 May 2024 11:32:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3YDX-00083C-V4; Sun, 05 May 2024 05:31: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 1s3YDT-000803-PY for emacs-devel@gnu.org; Sun, 05 May 2024 05:31:33 -0400 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3YDQ-0007QN-VM; Sun, 05 May 2024 05:31:30 -0400 Original-Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a598c8661f0so224388166b.0; Sun, 05 May 2024 02:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714901485; x=1715506285; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=caZBGIM7TIayGlj6xsOCt94Q+O/58AjJNe6FVFeBfZQ=; b=J85fX6jXc7GTwuOeehwrlHiPRUxXgCvfJvuPLb//mDrfOSWnBaus5JirMldDzIaIeL eIBn8F1gfG9syvXt+ov7vftkkEaN9tp/6ljRTdbSAuy1jqIlM0qU8yBQzUmgGjrrjdZo ebdA8q56l4BiP5LSpkYuplJ3A+Sh42hK0JomGPXiLzLEQiGvEKdT54A/E77gIDg3fagi VclVgDHDHlijmguZd+7ykJyJIVND+8PkQT8WIttBxsT/ScnodSMCf0Ktdu8VnoCB7sjY ub8bA1qJv8JaPIQgALm9oNoOTZ93Wvhn93fmErRNNbMwjZ+EY8i6ny+rT8N9I+OHoQLq ZVCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714901485; x=1715506285; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=caZBGIM7TIayGlj6xsOCt94Q+O/58AjJNe6FVFeBfZQ=; b=KSOiQ6QWPrLhN5lor4eVsu081bmj5a9QOyCdmWcufNQJetXX5WtSgyLXqHobrlfC5d jIBG882U7G7Xge1a9ezGbR6ga6Ctj5JEKIM+NgAI9A6XiuxMGo+Gq9BNvmyl/yDBEI9w TxKGcgFAAMCuuU2/wGWUTYy4mW5JuOC6yLKmYzSDuegSWLepBnht5U6jN1XPXBPKlT45 ZZCL7bRjz1VcRCnjPCwAX92f9sYAjYf3+rV4pPC9+7lSQbUhHNecXTrT3mkthZLU++kS F8FzbZ5B3XPQlYEwneBDRWfwgyPwHoaUcLJPcXvow6rlmPq4smJb1L8MpPX9ntnWdq/l k9MQ== X-Forwarded-Encrypted: i=1; AJvYcCUusyHo5Ok63rHPV+5tmRqEAObKa9FEAx3HghYbtMPoi76o1d+utlcSNsQApcz5xeaPzX2CvFDj5pIXswlQuMKc++b9 X-Gm-Message-State: AOJu0YwWMvKK+F4/7dqfDBhQeDdTXmL+rRtyFQMK/FE03NUDqdkD98+S tBzO3CmomlIcDxRbN2xuokCCpwxh0njsnXDqweCF3KhHPVlORZO+09uYeA== X-Google-Smtp-Source: AGHT+IFrho/wuW1MEJbgJT8XNX3o/oE4N3h5scKctIexlMh/8S5I+nIQXAMU8Dp9leAoYBvkcKfhtA== X-Received: by 2002:a17:907:724b:b0:a59:b88c:2b17 with SMTP id ds11-20020a170907724b00b00a59b88c2b17mr1696635ejc.44.1714901485178; Sun, 05 May 2024 02:31:25 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a20a.dip0.t-ipconnect.de. [79.227.162.10]) by smtp.gmail.com with ESMTPSA id gh5-20020a170906e08500b00a59a9ffeea6sm1558087ejb.96.2024.05.05.02.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 02:31:24 -0700 (PDT) In-Reply-To: <86ikzseipz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 12:00:40 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:318810 Archived-At: Eli Zaretskii writes: >> Pushed that, but not yet using it. We can always remove that later... > > It breaks the 32-bit build: > > In file included from lisp.h:42, > from igc.c:32: > igc.c: In function 'fix_ptr_vec': > ../lib/verify.h:213:41: error: static assertion failed: "verify (sizeof *h == sizeof *v)" > 213 | # define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC) > | ^~~~~~~~~~~~~~ > ../lib/verify.h:330:20: note: in expansion of macro '_GL_VERIFY' > 330 | # define verify(R) _GL_VERIFY (R, "verify (" #R ")", -) > | ^~~~~~~~~~ > igc.c:107:30: note: in expansion of macro 'verify' > 107 | #define igc_static_assert(x) verify (x) > | ^~~~~~ > igc.c:1085:5: note: in expansion of macro 'igc_static_assert' > 1085 | igc_static_assert (sizeof *h == sizeof *v); > | ^~~~~~~~~~~~~~~~~ > Makefile:453: recipe for target `igc.o' failed > > And I truly don't understand how it was supposed to work: > > static mps_res_t > fix_ptr_vec (mps_ss_t ss, void *client) > { > MPS_SCAN_BEGIN (ss) > { > struct igc_header *h = client_to_base (client); > void **v = client; > igc_static_assert (sizeof *h == sizeof *v); <<<<<<<<<<<<<<<<< > > Here '*v' is a pointer, whereas '*h' is 'struct igc_header', which is > a structure whose size is larger than 32 bits: I guess this comes from igc_header being 1 word on 64 bit, and 2 on 32-bit. Thing is we need to know how large the vector is to scan it. We have the info the igc_header::nwords. > enum > { > IGC_TYPE_BITS = 5, > IGC_PVEC_BITS = 6, > IGC_HASH_BITS = 21, > IGC_SIZE_BITS = 32 > }; > > struct igc_header > { > enum igc_obj_type obj_type : IGC_TYPE_BITS; > enum pvec_type pvec_type : IGC_PVEC_BITS; > mps_word_t hash : IGC_HASH_BITS; > mps_word_t nwords : IGC_SIZE_BITS; > }; > > So this can only work on a 64-bit architecture, and even then only if > the compiler packs the structure (which is entirely not guaranteed > AFAIK). Or what am I missing here? Apparently it only works as is on 64-bits and so on. What do you expect me to do? A thing I promise not to do is to develop and check on any platform except mine. > And wasn't it supposed to say > > void **v = &client; > > instead? The address of a local variable? I think it's correct as is.