aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-12-13 10:41:17 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-12-13 10:41:17 -0300
commit0bfc572e51d9035a615ef6e9523f736c9ffa8e57 (patch)
tree218f2bb13a873becf8fa657a296c8863f7e0e466 /manual
parent1de95e97ef65632a88e08b6184bd9d1ceba7ec2f (diff)
downloadlua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.tar.gz
lua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.tar.bz2
lua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.zip
Bug: GC is not reentrant
As the GC is not reentrant, finalizers should not be able to invoke it.
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of11
1 files changed, 6 insertions, 5 deletions
diff --git a/manual/manual.of b/manual/manual.of
index c9e62b49..c660215c 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -787,11 +787,8 @@ following the reverse order that they were marked.
787If any finalizer marks objects for collection during that phase, 787If any finalizer marks objects for collection during that phase,
788these marks have no effect. 788these marks have no effect.
789 789
790Finalizers cannot yield. 790Finalizers cannot yield nor run the garbage collector.
791Except for that, they can do anything, 791Because they can run in unpredictable times,
792such as raise errors, create new objects,
793or even run the garbage collector.
794However, because they can run in unpredictable times,
795it is good practice to restrict each finalizer 792it is good practice to restrict each finalizer
796to the minimum necessary to properly release 793to the minimum necessary to properly release
797its associated resource. 794its associated resource.
@@ -3276,6 +3273,8 @@ Returns the previous mode (@id{LUA_GCGEN} or @id{LUA_GCINC}).
3276For more details about these options, 3273For more details about these options,
3277see @Lid{collectgarbage}. 3274see @Lid{collectgarbage}.
3278 3275
3276This function should not be called by a finalizer.
3277
3279} 3278}
3280 3279
3281@APIEntry{lua_Alloc lua_getallocf (lua_State *L, void **ud);| 3280@APIEntry{lua_Alloc lua_getallocf (lua_State *L, void **ud);|
@@ -6233,6 +6232,8 @@ A zero means to not change that value.
6233See @See{GC} for more details about garbage collection 6232See @See{GC} for more details about garbage collection
6234and some of these options. 6233and some of these options.
6235 6234
6235This function should not be called by a finalizer.
6236
6236} 6237}
6237 6238
6238@LibEntry{dofile ([filename])| 6239@LibEntry{dofile ([filename])|