diff options
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 69 |
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 | |||
666 | the total number of objects to double before starting a new cycle. | 666 | the total number of objects to double before starting a new cycle. |
667 | The default value is 300; the maximum value is 1000. | 667 | The default value is 300; the maximum value is 1000. |
668 | 668 | ||
669 | The garbage-collector step multiplier | ||
670 | controls the speed of the collector relative to | ||
671 | object creation, | ||
672 | that is, | ||
673 | how many objects it marks or sweeps for each object created. | ||
674 | Larger values make the collector more aggressive. | ||
675 | Beware that values too small can | ||
676 | make the collector too slow to ever finish a cycle. | ||
677 | The default value is 200; the maximum value is 1000. | ||
678 | As a special case, a zero value means unlimited work, | ||
679 | effectively producing a non-incremental, stop-the-world collector. | ||
680 | |||
681 | The garbage-collector step size controls the | 669 | The garbage-collector step size controls the |
682 | size of each incremental step, | 670 | size of each incremental step, |
683 | specifically how many objects the interpreter creates | 671 | specifically how many objects the interpreter creates |
@@ -686,6 +674,17 @@ A value of @M{n} means the interpreter will create | |||
686 | approximately @M{n} objects between steps. | 674 | approximately @M{n} objects between steps. |
687 | The default value is 250. | 675 | The default value is 250. |
688 | 676 | ||
677 | The garbage-collector step multiplier | ||
678 | controls the size of each GC step. | ||
679 | A value of @M{n} means the interpreter will mark or sweep, | ||
680 | in each step, @M{n%} objects for each created object. | ||
681 | Larger values make the collector more aggressive. | ||
682 | Beware that values too small can | ||
683 | make the collector too slow to ever finish a cycle. | ||
684 | The default value is 200; the maximum value is 1000. | ||
685 | As a special case, a zero value means unlimited work, | ||
686 | effectively 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}. | |||
707 | The minor multiplier controls the frequency of minor collections. | 706 | The minor multiplier controls the frequency of minor collections. |
708 | For a minor multiplier @M{x}, | 707 | For a minor multiplier @M{x}, |
709 | a new minor collection will be done when the number of objects | 708 | a new minor collection will be done when the number of objects |
710 | grows @M{x%} larger than the number in use just after the last collection. | 709 | grows @M{x%} larger than the number in use just |
710 | after the last major collection. | ||
711 | For instance, for a multiplier of 20, | 711 | For instance, for a multiplier of 20, |
712 | the collector will do a minor collection when the number of objects | 712 | the collector will do a minor collection when the number of objects |
713 | gets 20% larger than the total after the last major collection. | 713 | gets 20% larger than the total after the last major collection. |
714 | The default value is 20. | 714 | The default value is 25. |
715 | 715 | ||
716 | The minor-major multiplier controls the shift to major collections. | 716 | The minor-major multiplier controls the shift to major collections. |
717 | For a multiplier @M{x}, | 717 | For a multiplier @M{x}, |
@@ -728,11 +728,10 @@ For a multiplier @M{x}, | |||
728 | the collector will shift back to minor collections | 728 | the collector will shift back to minor collections |
729 | after a major collection collects at least @M{x%} | 729 | after a major collection collects at least @M{x%} |
730 | of the objects allocated during the last cycle. | 730 | of the objects allocated during the last cycle. |
731 | |||
732 | In particular, for a multiplier of 0, | 731 | In particular, for a multiplier of 0, |
733 | the collector will immediately shift back to minor collections | 732 | the collector will immediately shift back to minor collections |
734 | after doing one cycle of major collections. | 733 | after doing one cycle of major collections. |
735 | The default value is 80. | 734 | The 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 | |||
3327 | memory in use by Lua by 1024. | 3326 | memory in use by Lua by 1024. |
3328 | } | 3327 | } |
3329 | 3328 | ||
3330 | @item{@defid{LUA_GCSTEP}| | 3329 | @item{@defid{LUA_GCSTEP} (int n)| |
3331 | Performs a step of garbage collection. | 3330 | Performs a step of garbage collection. |
3332 | } | 3331 | } |
3333 | 3332 | ||
@@ -3686,9 +3685,12 @@ Moreover, for a fixed buffer, | |||
3686 | the reader function should return the entire chunk in the first read. | 3685 | the 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, | 3688 | The function @Lid{lua_load} fully preserves the Lua stack |
3690 | so the reader function must always leave the stack | 3689 | through the calls to the reader function, |
3691 | unmodified when returning. | 3690 | except that it may push some values for internal use |
3691 | before the first call, | ||
3692 | and 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}| |
6346 | Performs a garbage-collection step. | 6348 | Performs a garbage-collection step. |
6349 | This option may be followed by an extra argument, | ||
6350 | an integer with the step size. | ||
6351 | The default for this argument is zero. | ||
6352 | |||
6353 | If the size is a positive @id{n}, | ||
6354 | the collector acts as if @id{n} new objects have been created. | ||
6355 | If the size is zero, | ||
6356 | the collector performs a basic step. | ||
6347 | In incremental mode, | 6357 | In incremental mode, |
6348 | that step corresponds to the current step size; | 6358 | a basic step corresponds to the current step size. |
6349 | the function returns @true if the step finished a collection cycle. | ||
6350 | In generational mode, | 6359 | In generational mode, |
6351 | the step performs a full minor collection or | 6360 | a basic step performs a full minor collection or |
6352 | a major collection, | 6361 | a major collection, |
6353 | if the collector has scheduled one; | 6362 | if the collector has scheduled one. |
6363 | |||
6364 | In incremental mode, | ||
6365 | the function returns @true if the step finished a collection cycle. | ||
6366 | In generational mode, | ||
6354 | the function returns @true if the step performed a major collection. | 6367 | the 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 | } |
6385 | To be able to divide by 100 | 6398 | Lua rounds these values before storing them; |
6386 | (as most parameters are given as percentages) | ||
6387 | without using floating-point arithmetic, | ||
6388 | Lua stores these parameters encoded. | ||
6389 | This encoding approximates the real value; | ||
6390 | so, the value returned as the previous value may not be | 6399 | so, the value returned as the previous value may not be |
6391 | equal to the last value set. | 6400 | exactly the last value set. |
6392 | } | 6401 | } |
6393 | 6402 | ||
6394 | } | 6403 | } |