GNU bug report logs - #75521
scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 12 Jan 2025 17:56:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pip Cet <pipcet <at> protonmail.com>
To: 75521 <at> debbugs.gnu.org
Cc: stefankangas <at> gmail.com
Subject: bug#75521: scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX
Date: Sun, 12 Jan 2025 22:36:12 +0000
"Stefan Kangas" <stefankangas <at> gmail.com> writes:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>> Stefan Kangas <stefankangas <at> gmail.com> writes:
>>
>>> Severity: wishlist
>>>
>>> Can we delete the unused macro DEFVAR_LISP_NOPROX?
>>
>> +1
>
> Thanks, done, closing.

Thanks!

On master, this comment might need revising (staticpro now easserts that
the same variable isn't added twice):

/* Similar but define a variable whose value is the Lisp Object stored
   at address.  Two versions: with and without gc-marking of the C
   variable.  The nopro version is used when that variable will be
   gc-marked for some other reason, since marking the same slot twice
   can cause trouble with strings.  */
void
defvar_lisp_nopro (struct Lisp_Fwd const *o_fwd, char const *namestring)
{
  eassert (o_fwd->type == Lisp_Fwd_Obj);
  Lisp_Object sym = intern_c_string (namestring);
  XBARE_SYMBOL (sym)->u.s.declared_special = true;
  XBARE_SYMBOL (sym)->u.s.redirect = SYMBOL_FORWARDED;
  SET_SYMBOL_FWD (XBARE_SYMBOL (sym), o_fwd);
}

Also on master, the single user of DEFVAR_LISP_NOPRO is questionable:
font.c doesn't staticpro Vfont_weight_table because it appears in
font_style_table, but then font_style_table is sometimes modified so it
points to a new vector, and I don't see how Vfont_weight_table is
protected then.

GDB experiment seems to indicate it's not protected at all, but it's in
the dump so it isn't freed either.  When --enable-checking is in use,
however, pdumper.c will abort the next time it sees an object that
wasn't marked during a previous GC run.

Pip





This bug report was last modified 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.