bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#68244: hash-table improvements


From: Gerd Möllmann
Subject: bug#68244: hash-table improvements
Date: Thu, 08 Feb 2024 15:36:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> But I think we can do something much simpler: vectors are accepted by
> simply storing in the first field a reference to the actual obarray
> object, so there's no need to play any games and/or share representation
> between vectors and obarray.

Fun fact:

  static Lisp_Object
  pkg_fake_me_an_obarray (Lisp_Object vector)
  {
    eassert (VECTORP (vector));
    Lisp_Object package = Faref (vector, make_fixnum (0));
    if (!PACKAGEP (package))
      {
        package = pkg_make_package (build_string ("obarray"),
                                    Flength (vector));
        Faset (vector, make_fixnum (0), package);
      }
    return package;
  }

Works like a charm :-). And the next pointer in Lisp_Symbol is also
gone.





reply via email to

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