summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-08-21 10:18:21 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-08-21 10:18:21 -0700
commit1b9d9d1659f819252abb4d8f49e5fd0f7bb56efd (patch)
treec425b1328e1ce7ac339c8d643740ff81fe473044
parentb2f09701eadc7dfb70f331869daf295628926af6 (diff)
downloademacs-1b9d9d1659f819252abb4d8f49e5fd0f7bb56efd.tar.gz
* lisp.h (vcopy): Use memcpy rather than our own loop.
This fixes a performance regression introduced by the recent addition of vcopy. This means 'vcopy' will need to be modified for a copying collector, but that's OK. Also, tighten the checking in the assertion.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/lisp.h7
2 files changed, 10 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 960639af152..ffd706a9a82 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lisp.h (vcopy): Use memcpy rather than our own loop.
+ This fixes a performance regression introduced by the recent
+ addition of vcopy. This means 'vcopy' will need to be modified
+ for a copying collector, but that's OK. Also, tighten the
+ checking in the assertion.
+
2012-08-21 Eli Zaretskii <eliz@gnu.org>
* w32uniscribe.c (uniscribe_shape): Fix producing gstring
diff --git a/src/lisp.h b/src/lisp.h
index 587e584b091..30bbb65f4fa 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2349,11 +2349,8 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
LISP_INLINE void
vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count)
{
- ptrdiff_t i;
-
- eassert (offset + count <= ASIZE (v));
- for (i = 0; i < count; i++)
- ASET (v, offset + i, args[i]);
+ eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v));
+ memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args);
}
/* Functions to modify hash tables. */