Let collectgarbage() behave as collectgarbage("collect")

This commit is contained in:
James Roseborough
2015-03-14 16:32:38 +00:00
parent c8e4bea43d
commit 6bde11639c
2 changed files with 2 additions and 1 deletions

View File

@@ -971,6 +971,7 @@ Files are no longer hosted at LuaForge.
<li>Fix string backing ownership issue when compiling many scripts.</li>
<li>Make LuaC compile state explicit and improve factoring.</li>
<li>Add sample build.gradle file for Android example.</li>
<li>collectgarbage() now behaves same as collectgarbage("collect") (fixes issue #41).</li>
</ul></td></tr>
</table></td></tr></table>

View File

@@ -134,7 +134,7 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder {
// "collectgarbage", // ( opt [,arg] ) -> value
static final class collectgarbage extends VarArgFunction {
public Varargs invoke(Varargs args) {
String s = args.checkjstring(1);
String s = args.optjstring(1, "collect");
if ( "collect".equals(s) ) {
System.gc();
return ZERO;