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: Thu, 04 Jul 2024 15:24:46 +0000 Message-ID: <_mNcR6ailVKpYHLxgfo_tJlYGeR0AQIzQWluspYYp5_g5pIIKkHLNfFkklQQgOKNiVW8jn8NS3i2dJ7_B2Qyx9v-Dq3MQ9mP8HNL30UWsqY=@protonmail.com> References: <-plQctKgNkvp-LJ9ov2QAiXQKxd9V-hI0yz_opRGxQtbknubCjH4rH2-ymgbw_Qr1ZhB1rtlmiEW8XtuIVNr7nR_Yj20AH6WkH6kUGp68g0=@protonmail.com> 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="34094"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Helmut Eller , Eli Zaretskii , 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 Thu Jul 04 17:58:44 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 1sPOr4-0008fe-Nq for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jul 2024 17:58:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPOp1-0001mt-QT; Thu, 04 Jul 2024 11:56:35 -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 1sPOKX-0004oC-67 for emacs-devel@gnu.org; Thu, 04 Jul 2024 11:25:05 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPOKN-0000xR-EG; Thu, 04 Jul 2024 11:25:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1720106691; x=1720365891; bh=RBMZa3lTKSEb+TiEYKln3N615OW/ehTwLPKcC0n1QEo=; 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=mutpagOZa17bdqkwuPYjm+Xi9gq2n0zFv4BvEisJOobVnWlO1lNTrYwxrFJsy+NQd 1b3Finr4pqPa35EVqQ/kl9HkOE8gdoPTiNwAJnwCn62HmjACeYNgU3o+8M+aSh49pp E+e1+ynzUHg4vzKQVSGvgIfzZ+8W82HHS4l1tNW9nmpPxNIyn6GbRFiJA+pR2Y3iKD n3cLZbre5rrqW2+fv6dEIYikbbP4upO/GOsA/BCrHt5aWS3j/7bMKoTC00YD7xn8Il +9n/UMljV9Pm1e50vxD0P7zxfa4tiuyuP071p3J2akn6h1Ma+Th+u/6dS2wNsTVC75 u2KedLdB+RvcA== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 29e05c575f4afa0b91d3c8c0b396730156a75418 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 04 Jul 2024 11:56:25 -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:321330 Archived-At: On Thursday, July 4th, 2024 at 07:17, Gerd M=C3=B6llmann wrote: > > > Move fast and break things. Normal. > >=20 > > I'm afraid I've continued to do so. After the last push, >=20 > Did that too yesterday for --enable-checking. and had to revert now :-) > > my TODO list is down to: > >=20 > > * fix bugs that slipped through (well, obviously) > > * user-defined hash table tests for weak tables don't work > > * key-or-value weakness doesn't work I believe we can make key-or-value tables work, and gain a potentially usef= ul debugging aid, by allowing struct igc_header to contain a tagged pointer= to an extended "header" structure which resides in external (non-MPS) memo= ry (a "remote reference" in MPS speak, which is usually forbidden in AMC po= ols but appears to work if it's non-MPS memory); we'd use the extended head= er instead of the header word to determine object size, hash, and object ty= pe. That extended header could then contain a Lisp_Object which would be sc= anned and kept alive while the object belonging to the header is allocated,= not just while it's still reachable. So if we (puthash a b key-or-value-hash), we'd make `a' keep alive `b' and = vice versa, but once they're no longer strongly reachable from other object= s, they'd be collected. (I've tried this, it works). And we could finalize objects appearing in weak hash tables. This would cause some memory fragmentation (xmalloc isn't moving), but I do= n't think that's much of an issue: if you're using exotic weak hashes, you'= re already creating unmovable allocations in weak_hash_pool; if you're debu= gging, you probably don't care. However, the functional gains are minimal and so far no one has demanded ke= y-or-value hashes... > I'm making another pass over C files in alpabetical order, trying to > find untraced references. At the source file I'm using (no Gtk and so > on). Now at buffer.c, and I think I see one. Good luck! Pip