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 | |
| 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')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/alloc.c | 18 | ||||
| -rw-r--r-- | src/eval.c | 15 |
3 files changed, 30 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d103f180c52..f79489fe4fa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-11-06 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * alloc.c (make_pure_c_string): New function. | ||
| 4 | |||
| 5 | * eval.c (Fautoload): Purecopy all arguments. | ||
| 6 | |||
| 1 | 2009-11-05 Kenichi Handa <handa@m17n.org> | 7 | 2009-11-05 Kenichi Handa <handa@m17n.org> |
| 2 | 8 | ||
| 3 | * fileio.c (Finsert_file_contents): Be sure set coding-system of | 9 | * fileio.c (Finsert_file_contents): Be sure set coding-system of |
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. */ |
diff --git a/src/eval.c b/src/eval.c index 136b75f756b..3945a1b7a55 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2127,16 +2127,13 @@ this does nothing and returns nil. */) | |||
| 2127 | /* Only add entries after dumping, because the ones before are | 2127 | /* Only add entries after dumping, because the ones before are |
| 2128 | not useful and else we get loads of them from the loaddefs.el. */ | 2128 | not useful and else we get loads of them from the loaddefs.el. */ |
| 2129 | LOADHIST_ATTACH (Fcons (Qautoload, function)); | 2129 | LOADHIST_ATTACH (Fcons (Qautoload, function)); |
| 2130 | |||
| 2131 | if (NILP (Vpurify_flag)) | ||
| 2132 | args[0] = file; | ||
| 2133 | else | 2130 | else |
| 2134 | args[0] = Fpurecopy (file); | 2131 | /* We don't want the docstring in purespace (instead, |
| 2135 | args[1] = docstring; | 2132 | Snarf-documentation should (hopefully) overwrite it). */ |
| 2136 | args[2] = interactive; | 2133 | docstring = make_number (0); |
| 2137 | args[3] = type; | 2134 | return Ffset (function, |
| 2138 | 2135 | Fpurecopy (list5 (Qautoload, file, docstring, | |
| 2139 | return Ffset (function, Fcons (Qautoload, Flist (4, &args[0]))); | 2136 | interactive, type))); |
| 2140 | } | 2137 | } |
| 2141 | 2138 | ||
| 2142 | Lisp_Object | 2139 | Lisp_Object |