From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: weak hash tables Date: Mon, 01 Jul 2024 23:10:01 +0000 Message-ID: <2syUQ04IbTWqDJjMfKSrtzWMWmFGq1GIOwSxv_r6BEyNDtk7ADADKjZk-90g9tSS9SKWppkiq6_zihUtsoE1spiopaOI6-v9inQrGxwMyCs=@protonmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Helmut Eller , Emacs Devel To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 02 04:24:23 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 1sOTBv-0004Na-Pp for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jul 2024 04:24:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOTAz-0002Ni-MN; Mon, 01 Jul 2024 22:23:25 -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 1sOQA0-0002LG-4T for emacs-devel@gnu.org; Mon, 01 Jul 2024 19:10:12 -0400 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOQ9x-0004U0-FL for emacs-devel@gnu.org; Mon, 01 Jul 2024 19:10:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719875406; x=1720134606; bh=UMv3kbU9U2ZXdq0jCtE/3RpzvncafHBvpZzXrwU6lio=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=jotNi3kPh8iDMiCnboz368XC7ipXo4jmIQ7MXS0fb702RtRne0Xch0ZE5aZ2wNWiw mzPb8nB/22YvC/0pUXR9ceH8ykbYDHkD+AGwlwvb8FErhzoJQebceoiYKrN2caWX2v jt4L1/Lb8/yWjoHC6hCntsNVeQT3DR8BIEiF3bwATJC1dV/EEdyMUoUWOL9BTEaUyd k369WWu048mntfFMYuODegXhTHCRrYRCE9/tx4CCZ9v+8pWKij5dzzep4lUUZDMjsB uqGEPQwQsQo0Mqr+wfW0ltGs8USgoUZWnhM1oMAEwSlqzEg44b2Dr02Q/1O1oAke8m Yzx43ZbvoHdMQ== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 0e6d2241f29474d5d0462a9babfb61af8d1deaee Received-SPF: pass client-ip=185.70.43.22; envelope-from=pipcet@protonmail.com; helo=mail-4322.protonmail.ch 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 01 Jul 2024 22:23:14 -0400 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:321085 Archived-At: On Monday, July 1st, 2024 at 21:16, Pip Cet wrote: > On Monday, July 1st, 2024 at 20:47, Gerd M=C3=B6llmann gerd.moellmann@gma= il.com wrote: > > I think that the index is given 2 * table_size room ATM, but I'm not > > sure if I read that right, and it's late. Is it sure that that suffices= ? >=20 > I believe it is, but it needs fixing anyway. Will do that next. Actually, I've run into another bug which needs to be fixed first: when the= hash table's strong part is allocated from MPS but t->table_size is still = Qnil, we sometimes end up scanning it (when trying to allocate the weak par= t), and then XFIXNUM (Qnil) dies, as it rightfully should, except it's in t= he middle of a scan so it dies quite horribly. Is it correct that all IGC objects need to be scannable when they're still = zeroed-out from allocation? (I'm currently trying to simply delay setting the weak->strong and strong->= weak pointers until the parts are initialized, and to turn the scan into a = nop if they aren't. I'm not convinced that's sufficient to prevent the comp= iler from reordering the initialization so an invalid state becomes visible= to the scan function, though...) Also, any opinions on :weakness 'key-or-value? Can we just not support it a= nd use strong hash tables instead? Pip