emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about DEFVAR_LISP_NOPRO


From: K. Handa
Subject: Re: Question about DEFVAR_LISP_NOPRO
Date: Sat, 18 May 2024 21:40:37 +0900

In article <jwvil0vbx6t.fsf-monnier+emacs@gnu.org>, Stefan Monnier 
<monnier@iro.umontreal.ca> writes:

> >   DEFVAR_LISP_NOPRO ("font-weight-table", Vfont_weight_table,
> >                  doc: /*  Vector of valid font weight values. ... */);
> >     Vfont_weight_table = BUILD_STYLE_TABLE (weight_table);
> >     make_symbol_constant (intern_c_string ("font-weight-table"));
> >
> > Here a symbol is defined which has a value that is forwarded to the
> > static globals.f_Vfont_weight_table, but that static is not staticpro'd.
> >
> > My question is simply: What the heck?

> I think only Kenichi knows the real answer (commit d0ab1ebe49f7), but my
> guess is that it was just an optimization because those vars always
> refer to each of the three elements of the `font_style_table` which *is*
> gcpro'd and is not exposed to ELisp so we know that a non-moving GC doesn't
> need to know about those vars.

As far as I remember, Stefan is right, it was for optimization.

---
K. Handa
handa@gnu.org



reply via email to

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