diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-12-13 10:41:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-12-13 10:41:17 -0300 |
commit | 0bfc572e51d9035a615ef6e9523f736c9ffa8e57 (patch) | |
tree | 218f2bb13a873becf8fa657a296c8863f7e0e466 /manual | |
parent | 1de95e97ef65632a88e08b6184bd9d1ceba7ec2f (diff) | |
download | lua-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.of | 11 |
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. | |||
787 | If any finalizer marks objects for collection during that phase, | 787 | If any finalizer marks objects for collection during that phase, |
788 | these marks have no effect. | 788 | these marks have no effect. |
789 | 789 | ||
790 | Finalizers cannot yield. | 790 | Finalizers cannot yield nor run the garbage collector. |
791 | Except for that, they can do anything, | 791 | Because they can run in unpredictable times, |
792 | such as raise errors, create new objects, | ||
793 | or even run the garbage collector. | ||
794 | However, because they can run in unpredictable times, | ||
795 | it is good practice to restrict each finalizer | 792 | it is good practice to restrict each finalizer |
796 | to the minimum necessary to properly release | 793 | to the minimum necessary to properly release |
797 | its associated resource. | 794 | its associated resource. |
@@ -3276,6 +3273,8 @@ Returns the previous mode (@id{LUA_GCGEN} or @id{LUA_GCINC}). | |||
3276 | For more details about these options, | 3273 | For more details about these options, |
3277 | see @Lid{collectgarbage}. | 3274 | see @Lid{collectgarbage}. |
3278 | 3275 | ||
3276 | This 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. | |||
6233 | See @See{GC} for more details about garbage collection | 6232 | See @See{GC} for more details about garbage collection |
6234 | and some of these options. | 6233 | and some of these options. |
6235 | 6234 | ||
6235 | This function should not be called by a finalizer. | ||
6236 | |||
6236 | } | 6237 | } |
6237 | 6238 | ||
6238 | @LibEntry{dofile ([filename])| | 6239 | @LibEntry{dofile ([filename])| |