diff options
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. */ |