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: weak hash tables Date: Tue, 02 Jul 2024 21:20:23 +0300 Message-ID: <86msmzbqqg.fsf@gnu.org> References: <86ed8cc4un.fsf@gnu.org> <86zfqzc3ky.fsf@gnu.org> <86plrvbydg.fsf@gnu.org> <_ThR9pdYMaIpZASWVEUqh-TuMSUydDM4v4g6QeKGUJE3ilY4tfRXHPiXAGG4RupeAl8BIJ8FFr2BUiWT9xUvB8W4uuEXypIz6GrGXYLPG88=@protonmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26161"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 02 20:21:26 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 1sOi85-0006dH-Ub for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jul 2024 20:21:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOi7I-0002cR-Lv; Tue, 02 Jul 2024 14:20: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 1sOi7B-0002c3-Ki for emacs-devel@gnu.org; Tue, 02 Jul 2024 14:20:30 -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 1sOi7A-0001Fr-Kt; Tue, 02 Jul 2024 14:20:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fD/Q0uVsHs/jSz02WT1kfFOdLYlSiO9G7vrsEioYSAo=; b=aQ31MVbd67ul MErq6X8TvpSSVKGcSY54+wOj3bNmTR83PkT8+lwI81kc8Zvw5aTrCIkgUAM9Uzsb6dPZxGPqCjnM8 llkFYyhh1hNLegp8ysYeUZIEhPIAfTr8TxjzsHNPSHxZ9XTSjlPl+yQu4MgTQxZOfCbWrQctdiWyU Uyhvkmz+4y/Miykfd1c/F5QrLtBnMtbcz8jzzaO6SVQHKvKlnN8IgYQQkKnAx6GcbZyy80+GTIJVR HYq92P+e3FT7rkeue1dXUVZQf5u8v2gsnexQaJ/6wjd47uLxn3GeV/LO8uIXlKogxj3/v02v9aEnc vj6bVH8QqHPJewuOkQwYcQ==; In-Reply-To: <_ThR9pdYMaIpZASWVEUqh-TuMSUydDM4v4g6QeKGUJE3ilY4tfRXHPiXAGG4RupeAl8BIJ8FFr2BUiWT9xUvB8W4uuEXypIz6GrGXYLPG88=@protonmail.com> (message from Pip Cet on Tue, 02 Jul 2024 16:34:40 +0000) 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:321192 Archived-At: > Date: Tue, 02 Jul 2024 16:34:40 +0000 > From: Pip Cet > Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org > > > > 1. mangle all Lisp_Objects to pointers or fixnums when storing them in a weak hash table, and unmangle them upon retrieval > > > 2. not use 32-bit x86 machines > > > 3. modify MPS > > > 4. throw caution to the wind and just hope it works > > I don't understand why (1) is needed. Lisp objects are already > > pointers in disguise, so what exactly is the problem here? > > They need to be aligned for MPS to understand they're pointers; they're unaligned, except for symbols which aren't pointers in the first place. In essence, MPS was focusing on the wrong language (for us). The pointers we hide in Lisp objects are already aligned. Why cannot we use them directly? > > I also don't understand how come an optimization turned out to do us > > some harm. > > Isn't that quite common, really? Not in my book, no. > Is it okay if I install the changes for Ihor's bugs first, then fix IA32? I still need to do some work to make sure they build without any unnecessary overhead in the !HAVE_MPS case. It doesn't matter in what order things are fixed as long as they are fixed.