aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of69
1 files changed, 39 insertions, 30 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 92d408e5..6fd0df6d 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -666,18 +666,6 @@ A value of 200 means that the collector waits for
666the total number of objects to double before starting a new cycle. 666the total number of objects to double before starting a new cycle.
667The default value is 300; the maximum value is 1000. 667The default value is 300; the maximum value is 1000.
668 668
669The garbage-collector step multiplier
670controls the speed of the collector relative to
671object creation,
672that is,
673how many objects it marks or sweeps for each object created.
674Larger values make the collector more aggressive.
675Beware that values too small can
676make the collector too slow to ever finish a cycle.
677The default value is 200; the maximum value is 1000.
678As a special case, a zero value means unlimited work,
679effectively producing a non-incremental, stop-the-world collector.
680
681The garbage-collector step size controls the 669The garbage-collector step size controls the
682size of each incremental step, 670size of each incremental step,
683specifically how many objects the interpreter creates 671specifically how many objects the interpreter creates
@@ -686,6 +674,17 @@ A value of @M{n} means the interpreter will create
686approximately @M{n} objects between steps. 674approximately @M{n} objects between steps.
687The default value is 250. 675The default value is 250.
688 676
677The garbage-collector step multiplier
678controls the size of each GC step.
679A value of @M{n} means the interpreter will mark or sweep,
680in each step, @M{n%} objects for each created object.
681Larger values make the collector more aggressive.
682Beware that values too small can
683make the collector too slow to ever finish a cycle.
684The default value is 200; the maximum value is 1000.
685As a special case, a zero value means unlimited work,
686effectively producing a non-incremental, stop-the-world collector.
687
689} 688}
690 689
691@sect3{genmode| @title{Generational Garbage Collection} 690@sect3{genmode| @title{Generational Garbage Collection}
@@ -707,11 +706,12 @@ and the @def{major-minor multiplier}.
707The minor multiplier controls the frequency of minor collections. 706The minor multiplier controls the frequency of minor collections.
708For a minor multiplier @M{x}, 707For a minor multiplier @M{x},
709a new minor collection will be done when the number of objects 708a new minor collection will be done when the number of objects
710grows @M{x%} larger than the number in use just after the last collection. 709grows @M{x%} larger than the number in use just
710after the last major collection.
711For instance, for a multiplier of 20, 711For instance, for a multiplier of 20,
712the collector will do a minor collection when the number of objects 712the collector will do a minor collection when the number of objects
713gets 20% larger than the total after the last major collection. 713gets 20% larger than the total after the last major collection.
714The default value is 20. 714The default value is 25.
715 715
716The minor-major multiplier controls the shift to major collections. 716The minor-major multiplier controls the shift to major collections.
717For a multiplier @M{x}, 717For a multiplier @M{x},
@@ -728,11 +728,10 @@ For a multiplier @M{x},
728the collector will shift back to minor collections 728the collector will shift back to minor collections
729after a major collection collects at least @M{x%} 729after a major collection collects at least @M{x%}
730of the objects allocated during the last cycle. 730of the objects allocated during the last cycle.
731
732In particular, for a multiplier of 0, 731In particular, for a multiplier of 0,
733the collector will immediately shift back to minor collections 732the collector will immediately shift back to minor collections
734after doing one cycle of major collections. 733after doing one cycle of major collections.
735The default value is 80. 734The default value is 50.
736 735
737} 736}
738 737
@@ -3327,7 +3326,7 @@ Returns the remainder of dividing the current amount of bytes of
3327memory in use by Lua by 1024. 3326memory in use by Lua by 1024.
3328} 3327}
3329 3328
3330@item{@defid{LUA_GCSTEP}| 3329@item{@defid{LUA_GCSTEP} (int n)|
3331Performs a step of garbage collection. 3330Performs a step of garbage collection.
3332} 3331}
3333 3332
@@ -3686,9 +3685,12 @@ Moreover, for a fixed buffer,
3686the reader function should return the entire chunk in the first read. 3685the reader function should return the entire chunk in the first read.
3687(As an example, @Lid{luaL_loadbufferx} does that.) 3686(As an example, @Lid{luaL_loadbufferx} does that.)
3688 3687
3689@id{lua_load} uses the stack internally, 3688The function @Lid{lua_load} fully preserves the Lua stack
3690so the reader function must always leave the stack 3689through the calls to the reader function,
3691unmodified when returning. 3690except that it may push some values for internal use
3691before the first call,
3692and it restores the stack size to its original size plus one
3693(for the pushed result) after the last call.
3692 3694
3693@id{lua_load} can return 3695@id{lua_load} can return
3694@Lid{LUA_OK}, @Lid{LUA_ERRSYNTAX}, or @Lid{LUA_ERRMEM}. 3696@Lid{LUA_OK}, @Lid{LUA_ERRSYNTAX}, or @Lid{LUA_ERRMEM}.
@@ -6344,13 +6346,24 @@ gives the exact number of bytes in use by Lua.
6344 6346
6345@item{@St{step}| 6347@item{@St{step}|
6346Performs a garbage-collection step. 6348Performs a garbage-collection step.
6349This option may be followed by an extra argument,
6350an integer with the step size.
6351The default for this argument is zero.
6352
6353If the size is a positive @id{n},
6354the collector acts as if @id{n} new objects have been created.
6355If the size is zero,
6356the collector performs a basic step.
6347In incremental mode, 6357In incremental mode,
6348that step corresponds to the current step size; 6358a basic step corresponds to the current step size.
6349the function returns @true if the step finished a collection cycle.
6350In generational mode, 6359In generational mode,
6351the step performs a full minor collection or 6360a basic step performs a full minor collection or
6352a major collection, 6361a major collection,
6353if the collector has scheduled one; 6362if the collector has scheduled one.
6363
6364In incremental mode,
6365the function returns @true if the step finished a collection cycle.
6366In generational mode,
6354the function returns @true if the step performed a major collection. 6367the function returns @true if the step performed a major collection.
6355} 6368}
6356 6369
@@ -6382,13 +6395,9 @@ The argument @id{param} must have one of the following values:
6382@item{@St{stepmul}| The step multiplier. } 6395@item{@St{stepmul}| The step multiplier. }
6383@item{@St{stepsize}| The step size. } 6396@item{@St{stepsize}| The step size. }
6384} 6397}
6385To be able to divide by 100 6398Lua rounds these values before storing them;
6386(as most parameters are given as percentages)
6387without using floating-point arithmetic,
6388Lua stores these parameters encoded.
6389This encoding approximates the real value;
6390so, the value returned as the previous value may not be 6399so, the value returned as the previous value may not be
6391equal to the last value set. 6400exactly the last value set.
6392} 6401}
6393 6402
6394} 6403}