comparison src/alloc.c @ 105871:1fa408e42f53

* alloc.c (make_pure_c_string): New function. * eval.c (Fautoload): Purecopy all arguments.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 06 Nov 2009 05:24:28 +0000
parents 68dd71358159
children 21bdda3ded62
comparison
equal deleted inserted replaced
105870:26baacb565b0 105871:1fa408e42f53
4819 s->intervals = NULL_INTERVAL; 4819 s->intervals = NULL_INTERVAL;
4820 XSETSTRING (string, s); 4820 XSETSTRING (string, s);
4821 return string; 4821 return string;
4822 } 4822 }
4823 4823
4824 /* Return a string a string allocated in pure space. Do not allocate
4825 the string data, just point to DATA. */
4826
4827 Lisp_Object
4828 make_pure_c_string (const char *data)
4829 {
4830 Lisp_Object string;
4831 struct Lisp_String *s;
4832 int nchars = strlen (data);
4833
4834 s = (struct Lisp_String *) pure_alloc (sizeof *s, Lisp_String);
4835 s->size = nchars;
4836 s->size_byte = -1;
4837 s->data = data;
4838 s->intervals = NULL_INTERVAL;
4839 XSETSTRING (string, s);
4840 return string;
4841 }
4824 4842
4825 /* Return a cons allocated from pure space. Give it pure copies 4843 /* Return a cons allocated from pure space. Give it pure copies
4826 of CAR as car and CDR as cdr. */ 4844 of CAR as car and CDR as cdr. */
4827 4845
4828 Lisp_Object 4846 Lisp_Object