lua-users home
lua-l archive

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

On Tue, Apr 16, 2019 at 12:05 PM 云风 Cloud Wu <> wrote:

Jim <>于2019年4月16日 周二20:20写道:

> What problem is only solved with reference counting ?

it releases resources ASAP, avoiding random stalls throughout script
execution and
thus provides a smoother runtime experience (games come to mind here).

there are algorithms that reduce these stalls
(incremental/generational garbage collection) but, given enough
objects, they will be noticeable again.

Reference counting have stalls problem, too. And not always smoother than gc. For example, releasing a very long linked list.

Reference counting also has issues with circularly-linked objects, which gc manages near-effortlessly.

As always, you must choose the right tool for the job.

/s/ Adam