diff src/fns.c @ 219:262b8bb4a523 r20-4b8

Import from CVS: tag r20-4b8
author cvs
date Mon, 13 Aug 2007 10:09:35 +0200
parents 78478c60bfcd
children 2c611d1463a6
line wrap: on
line diff
--- a/src/fns.c	Mon Aug 13 10:08:36 2007 +0200
+++ b/src/fns.c	Mon Aug 13 10:09:35 2007 +0200
@@ -3291,11 +3291,16 @@
        (fn, seq))
 {
   int len = XINT (Flength (seq));
-  Lisp_Object *args = alloca_array (Lisp_Object, len);
-
-  mapcar1 (len, args, fn, seq);
-
-  return Fvector (len, args);
+  /* Ideally, this should call make_vector_internal, because we don't
+     need initialization.  */
+  Lisp_Object result = make_vector (len, Qnil);
+  struct gcpro gcpro1;
+
+  GCPRO1 (result);
+  mapcar1 (len, XVECTOR_DATA (result), fn, seq);
+  UNGCPRO;
+
+  return result;
 }
 
 DEFUN ("mapc", Fmapc, 2, 2, 0, /*