diff options
| author | Dan Nicolaescu | 2009-11-06 05:24:28 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-11-06 05:24:28 +0000 |
| commit | a56eaaef7c9e641ecf6cc1cfb4cd3341e5118690 (patch) | |
| tree | 3e106d01bc9cf7d2704150fb884b879d98390555 /src/alloc.c | |
| parent | 1e8780b173424f554a7d2248140c05d2e5f98247 (diff) | |
| download | emacs-a56eaaef7c9e641ecf6cc1cfb4cd3341e5118690.tar.gz emacs-a56eaaef7c9e641ecf6cc1cfb4cd3341e5118690.zip | |
* alloc.c (make_pure_c_string): New function.
* eval.c (Fautoload): Purecopy all arguments.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 557621af797..a074bfe2d72 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4821,6 +4821,24 @@ make_pure_string (data, nchars, nbytes, multibyte) | |||
| 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. */ |