diff options
| author | Eli Zaretskii | 2014-09-30 19:21:22 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-09-30 19:21:22 +0300 |
| commit | eaa8c21089bd18af88dff80ae92c5eedcf3d7dda (patch) | |
| tree | 470fa6df752644f3d404682754992fc6d8e2aed5 | |
| parent | 6e28231a10a2c049725942bfcdb71d765822d8d6 (diff) | |
| download | emacs-eaa8c21089bd18af88dff80ae92c5eedcf3d7dda.tar.gz emacs-eaa8c21089bd18af88dff80ae92c5eedcf3d7dda.zip | |
Fix last change in lispref.
doc/lispref/internals.texi (Stack-allocated Objects): Minor improvements of
the wording and the indexing.
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 42 |
2 files changed, 27 insertions, 20 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 36918dac2e4..0aba61e53e9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-09-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * internals.texi (Stack-allocated Objects): Minor improvements of | ||
| 4 | the wording and the indexing. | ||
| 5 | |||
| 1 | 2014-09-30 Dmitry Antipov <dmantipov@yandex.ru> | 6 | 2014-09-30 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 7 | ||
| 3 | * internals.texi (Stack-allocated Objects): Describe this feature. | 8 | * internals.texi (Stack-allocated Objects): Describe this feature. |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 1bafd22fd43..3ef82eb81aa 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -533,27 +533,29 @@ floating-point number. | |||
| 533 | @node Stack-allocated Objects | 533 | @node Stack-allocated Objects |
| 534 | @section Stack-allocated Objects | 534 | @section Stack-allocated Objects |
| 535 | 535 | ||
| 536 | @cindex stack allocation overview | 536 | @cindex stack allocated Lisp objects |
| 537 | @cindex Lisp objects, stack-allocated | ||
| 537 | The garbage collector described above is used to manage data visible | 538 | The garbage collector described above is used to manage data visible |
| 538 | from Lisp program, as well as the most of data internally used by the | 539 | from Lisp programs, as well as most of the data internally used by the |
| 539 | interpreter. But sometimes it may be useful to allocate temporary | 540 | Lisp interpreter. But sometimes it may be useful to allocate |
| 540 | internal (i.e. not visible for Lisp program) objects using C stack of | 541 | temporary internal (i.e.@: not visible for a Lisp program) objects |
| 541 | an interpreter. Currently conses and strings are the only objects which | 542 | using the C stack of the interpreter. Currently, only cons cells and |
| 542 | can be allocated in that way. Strings are limited to ASCII characters | 543 | strings can be allocated that way. Stack-allocated strings are |
| 543 | only and should be treated as immutable (calling @code{ASET} on them is | 544 | limited to @acronym{ASCII} characters only, and should be treated as |
| 544 | undefined). | 545 | immutable (calling @code{ASET} on them produces undefined behavior). |
| 545 | 546 | ||
| 546 | @cindex stack allocation internals | 547 | In C, this is implemented as special macros which expand into a |
| 547 | In C, this is implemented as a special macros which expands to | 548 | @code{Lisp_Object} with block-scoped semantics and lifetime (see the |
| 548 | a @code{Lisp_Object} with block-scoped semantics and lifetime (see | 549 | code around @code{USE_STACK_LISP_OBJECTS} in @file{src/lisp.h}). This |
| 549 | the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}). This | 550 | means that these objects are not freed by the garbage collector; |
| 550 | means that these objects are not managed by the garbage collector; | 551 | instead, they are allocated like local variables in C and |
| 551 | instead, they are allocated like local variables in C and automatically | 552 | automatically freed when execution goes out of the scope where the |
| 552 | freed when an execution reaches an end of the corresponding scope. Thus, | 553 | object was allocated. Thus, allocating and freeing these objects is |
| 553 | allocation and freeing are faster than using garbage collector. But | 554 | faster than when using heap memory to allocate and the garbage |
| 554 | remember that passing them out of their scope results in undefined | 555 | collector to free their memory. Note that using such objects out of |
| 555 | behavior. Think twice before using this feature and carefully debug | 556 | their scope will result in undefined behavior, so code using them |
| 556 | your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}). | 557 | should be well thought out and carefully debugged by using the |
| 558 | @code{GC_CHECK_MARKED_OBJECTS} feature (see @file{src/alloc.c}). | ||
| 557 | 559 | ||
| 558 | @node Memory Usage | 560 | @node Memory Usage |
| 559 | @section Memory Usage | 561 | @section Memory Usage |