lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It seems rather limiting to me to just allow this one predefined
> auto-threshold. It would be more flexible to permit the user to define an
> automatic post-GC function which is called upon completion of GC with the
> current memory info, and which returns the new desired threshold.

1) Programming is rather limiting.

2) "The cheapest, fastest, and more reliable components of a system are
those that aren't there." Or, as Asko pointed out, "Every additional
feature also adds to the learning curve, documentation pages, etc.
etc.".

3) When we stop asking for new features, we have more time (and
motivation) to realize how to implement them.

(I leave this "automatic post-GC function" as an exercise. Hints:
* "automatic post-GC function" -> gc metamethod
* "current memory info" -> lua_getgcthreshold/count"
* "returns the new desired threshold" -> lua_setgcthreshold
)

-- Roberto