summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-01-21 20:01:10 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-01-21 20:03:34 -0800
commit74244d239e9093035c369721b469529a5fdaf1c6 (patch)
tree971d34cc4c4c1ba554ae7dc8faeb274fe413e3e3 /src/alloc.c
parent03346fb0747ddb39786bd9e43fe7f422cd48b9fe (diff)
downloademacs-74244d239e9093035c369721b469529a5fdaf1c6.tar.gz
Better isolate code that assumes NIL_IS_ZERO
Suggested by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00588.html * alloc.c (allocate_pseudovector): Use memclear, not memsetnil, to remove a 'verify'. * callint.c (Fcall_interactively): * dispnew.c (realloc_glyph_pool): * xdisp.c (init_iterator): Use memclear, not memset, to remove a 'verify'. * lisp.h (memclear): Rename from memsetnil, and take a byte count rather than a word count. All callers changed.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c
index bf0456c6862..571b2b03a29 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3174,11 +3174,8 @@ allocate_pseudovector (int memlen, int lisplen,
eassert (memlen - lisplen <= (1 << PSEUDOVECTOR_REST_BITS) - 1);
eassert (lisplen <= (1 << PSEUDOVECTOR_SIZE_BITS) - 1);
- /* Only the first LISPLEN slots will be traced normally by the GC.
- Since Qnil == 0, we can memset Lisp and non-Lisp data at one go. */
- verify (NIL_IS_ZERO);
- memsetnil (v->contents, zerolen);
-
+ /* Only the first LISPLEN slots will be traced normally by the GC. */
+ memclear (v->contents, zerolen * word_size);
XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen);
return v;
}