Commit Diff


commit - b126871012fbb9a9f2c86c662ea93e802f4e3e29
commit + 19a96d85bc867026e578597defc19dfcef936f63
blob - 20612fbcd658221acc5e29a7f900766e7f2b3ebc
blob + 50a1da586318e80f32d33a7a17c4ceec91dc794c
--- lua_close.3
+++ lua_close.3
@@ -3,7 +3,7 @@
 .Os
 .Sh NAME
 .Nm lua_close
-.Nd ensures that there are at least extra free stack slots in the stack, function indicator
+.Nd destroys all objects and frees all dynamic memory, function indicator
 .Bq -0, +0, -
 .Sh SYNOPSIS
 .In lua.h
@@ -11,10 +11,14 @@
 .Fn lua_close "lua_State *L"
 .Sh DESCRIPTION
 .Fn lua_close
-ensures that there are at least extra free stack slots in the stack.
-It returns false if it cannot grow the stack to that size.
-This function never shrinks the stack; if the stack is already larger than the
-new size, it is left unchanged.
+destroys all objects in the given Lua state (calling the corresponding
+garbage-collection metamethods, if any) and frees all dynamic memory used by
+this state.
+On several platforms, you may not need to call this function, because all
+resources are naturally released when the host program ends.
+On the other hand, long-running programs, such as a daemon or a web server,
+might need to release states as soon as they are not needed, to avoid growing
+too large.
 .Sh SEE ALSO
 .Rs
 .%A Roberto Ierusalimschy
blob - a8c39cf36b21bec13fcc76909d12af4c5511daf1
blob + f5e02fc0813935a39b4433b5aade66d3123f9d7b
--- lua_close.3.html
+++ lua_close.3.html
@@ -18,8 +18,8 @@
 <section class="Sh">
 <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
 <p class="Pp"><code class="Nm">lua_close</code> &#x2014;
-    <span class="Nd">ensures that there are at least extra free stack slots in
-    the stack, function indicator [-0, +0, -]</span></p>
+    <span class="Nd">destroys all objects and frees all dynamic memory, function
+    indicator [-0, +0, -]</span></p>
 </section>
 <section class="Sh">
 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
@@ -33,10 +33,13 @@
 <section class="Sh">
 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
 <p class="Pp"><a class="permalink" href="#lua_close"><code class="Fn" id="lua_close">lua_close</code></a>()
-    ensures that there are at least extra free stack slots in the stack. It
-    returns false if it cannot grow the stack to that size. This function never
-    shrinks the stack; if the stack is already larger than the new size, it is
-    left unchanged.</p>
+    destroys all objects in the given Lua state (calling the corresponding
+    garbage-collection metamethods, if any) and frees all dynamic memory used by
+    this state. On several platforms, you may not need to call this function,
+    because all resources are naturally released when the host program ends. On
+    the other hand, long-running programs, such as a daemon or a web server,
+    might need to release states as soon as they are not needed, to avoid
+    growing too large.</p>
 </section>
 <section class="Sh">
 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE