comparison src/alloc.c @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 0132846995bd
children 15872534500d
comparison
equal deleted inserted replaced
164:4e0740e5aab2 165:5a88923fcbfe
37 Added lcrecord lists for 19.14. 37 Added lcrecord lists for 19.14.
38 */ 38 */
39 39
40 #include <config.h> 40 #include <config.h>
41 #include "lisp.h" 41 #include "lisp.h"
42 #include "sysdep.h"
42 43
43 #ifndef standalone 44 #ifndef standalone
44 #include "backtrace.h" 45 #include "backtrace.h"
45 #include "buffer.h" 46 #include "buffer.h"
46 #include "bytecode.h" 47 #include "bytecode.h"
177 178
178 /* Index in pure at which next pure object will be allocated. */ 179 /* Index in pure at which next pure object will be allocated. */
179 static long pureptr; 180 static long pureptr;
180 181
181 #define PURIFIED(ptr) \ 182 #define PURIFIED(ptr) \
182 ((PNTR_COMPARISON_TYPE) (ptr) < \ 183 ((uintptr_t) (ptr) < \
183 (PNTR_COMPARISON_TYPE) (PUREBEG + PURESIZE) && \ 184 (uintptr_t) (PUREBEG + PURESIZE) && \
184 (PNTR_COMPARISON_TYPE) (ptr) >= \ 185 (uintptr_t) (ptr) >= \
185 (PNTR_COMPARISON_TYPE) PUREBEG) 186 (uintptr_t) PUREBEG)
186 187
187 /* Non-zero if pureptr > PURESIZE; accounts for excess purespace needs. */ 188 /* Non-zero if pureptr > PURESIZE; accounts for excess purespace needs. */
188 static long pure_lossage; 189 static long pure_lossage;
189 190
190 #ifdef ERROR_CHECK_TYPECHECK 191 #ifdef ERROR_CHECK_TYPECHECK
1023 Return a newly created list with specified arguments as elements. 1024 Return a newly created list with specified arguments as elements.
1024 Any number of arguments, even zero arguments, are allowed. 1025 Any number of arguments, even zero arguments, are allowed.
1025 */ 1026 */
1026 (int nargs, Lisp_Object *args)) 1027 (int nargs, Lisp_Object *args))
1027 { 1028 {
1028 Lisp_Object len, val, val_tail; 1029 Lisp_Object val = Qnil;
1029 1030 Lisp_Object *argp = args + nargs;
1030 len = make_int (nargs); 1031
1031 val = Fmake_list (len, Qnil); 1032 while (nargs-- > 0)
1032 val_tail = val; 1033 val = Fcons (*--argp, val);
1033 while (!NILP (val_tail))
1034 {
1035 XCAR (val_tail) = *args++;
1036 val_tail = XCDR (val_tail);
1037 }
1038 return val; 1034 return val;
1039 } 1035 }
1040 1036
1041 Lisp_Object 1037 Lisp_Object
1042 list1 (Lisp_Object obj0) 1038 list1 (Lisp_Object obj0)