emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPS: weak hash tables


From: Pip Cet
Subject: Re: MPS: weak hash tables
Date: Tue, 02 Jul 2024 20:16:10 +0000

On Tuesday, July 2nd, 2024 at 18:20, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Tue, 02 Jul 2024 16:34:40 +0000
> 
> > From: Pip Cet pipcet@protonmail.com
> > 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?

We need to store the tag somewhere, and I'm not entirely sure it's okay for the 
pointer to be anything but an MPS base pointer, which is a struct igc_header *, 
not, say, a struct Lisp_Cons *. I'll go check the docs again.

Pip




reply via email to

[Prev in Thread] Current Thread [Next in Thread]