[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/igc 75fe8c7e328: Remove DEFVAR_LISP_NOPRO
From: |
Eli Zaretskii |
Subject: |
feature/igc 75fe8c7e328: Remove DEFVAR_LISP_NOPRO |
Date: |
Sat, 1 Feb 2025 09:29:25 -0500 (EST) |
branch: feature/igc
commit 75fe8c7e3289dc121890c05491eb8d2df9e1db54
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Remove DEFVAR_LISP_NOPRO
* src/alloc.c (process_mark_stack):
* src/lread.c (defvar_lisp_nopro):
* src/lisp.h (DEFVAR_LISP_NOPRO):
* src/font.c (syms_of_font): Remove the function and the macro,
their callers, and related comments.
---
src/alloc.c | 4 +---
src/font.c | 9 +++------
src/lisp.h | 18 +-----------------
src/lread.c | 14 ++------------
4 files changed, 7 insertions(+), 38 deletions(-)
diff --git a/src/alloc.c b/src/alloc.c
index c1e4b1b96e4..61b30cfe6fb 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7012,9 +7012,7 @@ process_mark_stack (ptrdiff_t base_sp)
/* If the value is forwarded to a buffer or keyboard field,
these are marked when we see the corresponding object.
And if it's forwarded to a C variable, either it's not
- a Lisp_Object var, or it's staticpro'd already, or it's
- reachable from font_style_table which is also
- staticpro'd. */
+ a Lisp_Object var, or it's staticpro'd already. */
break;
default: emacs_abort ();
}
diff --git a/src/font.c b/src/font.c
index dfe479f9355..a1843bcb1ce 100644
--- a/src/font.c
+++ b/src/font.c
@@ -5970,7 +5970,7 @@ gets the repertory information by an opened font and
ENCODING. */);
table used by the font display code. So we make them read-only,
to avoid this confusing situation. */
- DEFVAR_LISP_NOPRO ("font-weight-table", Vfont_weight_table,
+ DEFVAR_LISP ("font-weight-table", Vfont_weight_table,
doc: /* Vector of valid font weight values.
Each element has the form:
[NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...]
@@ -5979,23 +5979,20 @@ This variable cannot be set; trying to do so will
signal an error. */);
Vfont_weight_table = BUILD_STYLE_TABLE (weight_table);
make_symbol_constant (intern_c_string ("font-weight-table"));
- DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table,
+ DEFVAR_LISP ("font-slant-table", Vfont_slant_table,
doc: /* Vector of font slant symbols vs the corresponding
numeric values.
See `font-weight-table' for the format of the vector.
This variable cannot be set; trying to do so will signal an error. */);
Vfont_slant_table = BUILD_STYLE_TABLE (slant_table);
make_symbol_constant (intern_c_string ("font-slant-table"));
- DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table,
+ DEFVAR_LISP ("font-width-table", Vfont_width_table,
doc: /* Alist of font width symbols vs the corresponding
numeric values.
See `font-weight-table' for the format of the vector.
This variable cannot be set; trying to do so will signal an error. */);
Vfont_width_table = BUILD_STYLE_TABLE (width_table);
make_symbol_constant (intern_c_string ("font-width-table"));
- /* Because the above 3 variables are slots in the vector we create
- below, and because that vector is staticpro'd, we don't explicitly
- staticpro the variables, to avoid wasting slots in staticvec[]. */
staticpro (&font_style_table);
font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table,
Vfont_width_table);
diff --git a/src/lisp.h b/src/lisp.h
index 96777579743..4c1d90f949d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3727,7 +3727,6 @@ call0 (Lisp_Object fn)
}
extern void defvar_lisp (struct Lisp_Fwd const *, char const *);
-extern void defvar_lisp_nopro (struct Lisp_Fwd const *, char const *);
extern void defvar_bool (struct Lisp_Fwd const *, char const *);
extern void defvar_int (struct Lisp_Fwd const *, char const *);
extern void defvar_kboard (struct Lisp_Fwd const *, char const *);
@@ -3749,12 +3748,7 @@ extern void defvar_kboard (struct Lisp_Fwd const *, char
const *);
All C code uses the `cons_cells_consed' name. This is all done
this way to support indirection for multi-threaded Emacs.
- DEFVAR_LISP staticpro's the variable; DEFVAR_LISP_NOPRO does not, and
- is used for variables that are protected in other ways (e.g., because
- they can be accessed from another variable, which is itself
- protected, see font_style_table on font.c as an example). This is
- not used in the HAVE_MPS build, where DEFVAR_LISP_NOPRO is equivalent
- to DEFVAR_LISP. */
+ DEFVAR_LISP staticpro's the variable. */
#define DEFVAR_LISP(lname, vname, doc) \
do { \
@@ -3762,16 +3756,6 @@ extern void defvar_kboard (struct Lisp_Fwd const *, char
const *);
= {Lisp_Fwd_Obj, .u.objvar = &globals.f_##vname}; \
defvar_lisp (&o_fwd, lname); \
} while (false)
-#ifdef HAVE_MPS
-#define DEFVAR_LISP_NOPRO DEFVAR_LISP
-#else
-#define DEFVAR_LISP_NOPRO(lname, vname, doc) \
- do { \
- static struct Lisp_Fwd const o_fwd \
- = {Lisp_Fwd_Obj, .u.objvar = &globals.f_##vname}; \
- defvar_lisp_nopro (&o_fwd, lname); \
- } while (false)
-#endif
#define DEFVAR_BOOL(lname, vname, doc) \
do { \
static struct Lisp_Fwd const b_fwd \
diff --git a/src/lread.c b/src/lread.c
index de524f0af5b..75de3d0e732 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -5485,25 +5485,15 @@ defvar_bool (struct Lisp_Fwd const *b_fwd, char const
*namestring)
}
/* 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. */
+ at address. */
void
-defvar_lisp_nopro (struct Lisp_Fwd const *o_fwd, char const *namestring)
+defvar_lisp (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);
-}
-
-void
-defvar_lisp (struct Lisp_Fwd const *o_fwd, char const *namestring)
-{
- eassert (o_fwd->type == Lisp_Fwd_Obj);
- defvar_lisp_nopro (o_fwd, namestring);
staticpro (o_fwd->u.objvar);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/igc 75fe8c7e328: Remove DEFVAR_LISP_NOPRO,
Eli Zaretskii <=