aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2014-09-30 19:21:22 +0300
committerEli Zaretskii2014-09-30 19:21:22 +0300
commiteaa8c21089bd18af88dff80ae92c5eedcf3d7dda (patch)
tree470fa6df752644f3d404682754992fc6d8e2aed5
parent6e28231a10a2c049725942bfcdb71d765822d8d6 (diff)
downloademacs-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/ChangeLog5
-rw-r--r--doc/lispref/internals.texi42
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 @@
12014-09-30 Eli Zaretskii <eliz@gnu.org>
2
3 * internals.texi (Stack-allocated Objects): Minor improvements of
4 the wording and the indexing.
5
12014-09-30 Dmitry Antipov <dmantipov@yandex.ru> 62014-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
538from Lisp program, as well as the most of data internally used by the 539from Lisp programs, as well as most of the data internally used by the
539interpreter. But sometimes it may be useful to allocate temporary 540Lisp interpreter. But sometimes it may be useful to allocate
540internal (i.e. not visible for Lisp program) objects using C stack of 541temporary internal (i.e.@: not visible for a Lisp program) objects
541an interpreter. Currently conses and strings are the only objects which 542using the C stack of the interpreter. Currently, only cons cells and
542can be allocated in that way. Strings are limited to ASCII characters 543strings can be allocated that way. Stack-allocated strings are
543only and should be treated as immutable (calling @code{ASET} on them is 544limited to @acronym{ASCII} characters only, and should be treated as
544undefined). 545immutable (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
548a @code{Lisp_Object} with block-scoped semantics and lifetime (see 549code around @code{USE_STACK_LISP_OBJECTS} in @file{src/lisp.h}). This
549the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}). This 550means that these objects are not freed by the garbage collector;
550means that these objects are not managed by the garbage collector; 551instead, they are allocated like local variables in C and
551instead, they are allocated like local variables in C and automatically 552automatically freed when execution goes out of the scope where the
552freed when an execution reaches an end of the corresponding scope. Thus, 553object was allocated. Thus, allocating and freeing these objects is
553allocation and freeing are faster than using garbage collector. But 554faster than when using heap memory to allocate and the garbage
554remember that passing them out of their scope results in undefined 555collector to free their memory. Note that using such objects out of
555behavior. Think twice before using this feature and carefully debug 556their scope will result in undefined behavior, so code using them
556your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}). 557should 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