diff options
| author | Eli Zaretskii | 2019-06-26 18:02:26 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-06-26 18:02:26 +0300 |
| commit | 7648c125dfdd0232362c35c2898bbe355c874dc1 (patch) | |
| tree | 34983c70e7bf506cec52fbc35fb1a46af432096d | |
| parent | e62ad04963982ea9cc7622b32484778845bc2ec1 (diff) | |
| download | emacs-7648c125dfdd0232362c35c2898bbe355c874dc1.tar.gz emacs-7648c125dfdd0232362c35c2898bbe355c874dc1.zip | |
Clarify a subtle issue in the Internals chapter of lispref
* doc/lispref/internals.texi (Writing Emacs Primitives):
Clarify the issue with relocation of buffer or string text as
side effect of Lisp evaluation. (Bug#36392)
| -rw-r--r-- | doc/lispref/internals.texi | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 62a102e3845..7cbd2966839 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -825,10 +825,14 @@ the type explicitly using a suitable predicate (@pxref{Type Predicates}). | |||
| 825 | @code{args} refers to objects controlled by Emacs's stack-marking | 825 | @code{args} refers to objects controlled by Emacs's stack-marking |
| 826 | garbage collector. Although the garbage collector does not reclaim | 826 | garbage collector. Although the garbage collector does not reclaim |
| 827 | objects reachable from C @code{Lisp_Object} stack variables, it may | 827 | objects reachable from C @code{Lisp_Object} stack variables, it may |
| 828 | move non-object components of an object, such as string contents; so | 828 | move some of the components of an object, such as the contents of a |
| 829 | functions that access non-object components must take care to refetch | 829 | string or the text of a buffer. Therefore, functions that access |
| 830 | their addresses after performing Lisp evaluation. Lisp evaluation can | 830 | these components must take care to refetch their addresses after |
| 831 | occur via calls to @code{eval_sub} or @code{Feval}, either directly or | 831 | performing Lisp evaluation. This means that instead of keeping C |
| 832 | pointers to string contents or buffer text, the code should keep the | ||
| 833 | buffer or string position, and recompute the C pointer from the | ||
| 834 | position after performing Lisp evaluation. Lisp evaluation can occur | ||
| 835 | via calls to @code{eval_sub} or @code{Feval}, either directly or | ||
| 832 | indirectly. | 836 | indirectly. |
| 833 | 837 | ||
| 834 | @cindex @code{maybe_quit}, use in Lisp primitives | 838 | @cindex @code{maybe_quit}, use in Lisp primitives |