aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/lisp.h b/src/lisp.h
index a1ea35574c3..119257bc4b9 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1503,18 +1503,22 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1503 XVECTOR (array)->contents[idx] = val; 1503 XVECTOR (array)->contents[idx] = val;
1504} 1504}
1505 1505
1506/* True, since Qnil's representation is zero. Every place in the code 1506/* True if Qnil's representation is nonzero. This is always false currently,
1507 that assumes Qnil is zero should verify (NIL_IS_ZERO), to make it easy 1507 but there is fallback code for hypothetical alternative implementations.
1508 to find such assumptions later if we change Qnil to be nonzero. */ 1508 Compile with -DNIL_IS_NONZERO to test the fallback code. */
1509enum { NIL_IS_ZERO = XLI_BUILTIN_LISPSYM (iQnil) == 0 }; 1509#ifndef NIL_IS_NONZERO
1510enum { NIL_IS_NONZERO = XLI_BUILTIN_LISPSYM (iQnil) != 0 };
1511#endif
1510 1512
1511/* Set a Lisp_Object array V's SIZE entries to nil. */ 1513/* Set a Lisp_Object array V's N entries to nil. */
1512INLINE void 1514INLINE void
1513memsetnil (Lisp_Object *v, ptrdiff_t size) 1515memsetnil (Lisp_Object *v, ptrdiff_t n)
1514{ 1516{
1515 eassert (0 <= size); 1517 eassert (0 <= n);
1516 verify (NIL_IS_ZERO); 1518 memset (v, 0, n * sizeof *v);
1517 memset (v, 0, size * sizeof *v); 1519 if (NIL_IS_NONZERO)
1520 for (ptrdiff_t i = 0; i < n; i++)
1521 v[i] = Qnil;
1518} 1522}
1519 1523
1520/* If a struct is made to look like a vector, this macro returns the length 1524/* If a struct is made to look like a vector, this macro returns the length