Mercurial > emacs
diff 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 |
line wrap: on
line diff
--- a/src/alloc.c Fri Nov 06 05:16:23 2009 +0000 +++ b/src/alloc.c Fri Nov 06 05:24:28 2009 +0000 @@ -4821,6 +4821,24 @@ return string; } +/* Return a string a string allocated in pure space. Do not allocate + the string data, just point to DATA. */ + +Lisp_Object +make_pure_c_string (const char *data) +{ + Lisp_Object string; + struct Lisp_String *s; + int nchars = strlen (data); + + s = (struct Lisp_String *) pure_alloc (sizeof *s, Lisp_String); + s->size = nchars; + s->size_byte = -1; + s->data = data; + s->intervals = NULL_INTERVAL; + XSETSTRING (string, s); + return string; +} /* Return a cons allocated from pure space. Give it pure copies of CAR as car and CDR as cdr. */
