[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Garbage collection / finalization of Lua functions
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 7 Sep 2015 09:35:07 -0300
> > You should look at the tests :-)
> Do you mean look at the tests for a solution? Or do you mean that
> using GCSTEP is the right thing to do, but look at the tests for the
> cause of the test failure? (From below I think you mean the latter).
I mean you need to fix the tests for your implementation. (See below.)
> > Tests in gc.lua (and some other places)
> > assume some specifc behhavior of the gc (e.g., it will not trigger a
> > new cycle immediately after the last one); small changes in GC hehavior
> > can break the tests without violating anything about the official
> > specification.
> Ok, I will have to see how to avoid breaking the tests.
> BTW calling lua_gc() from inside luaD_precall() (where JIT compilation
> takes place) causes an assertion failure when ltests is linked - the
> assertion fails as lock count was not equal to 0 when entering
> lua_gc(). So I had to wrap the call to lua_gc() in unlock/lock - but
> not sure if this is the right thing to do.
The tests are not meant to be portable across implementations. Note
that we do not even have a test suite for "Lua 5.3": the suites
are specific for each release (5.3.0, 5.3.1, etc.). These are not
"conformance" tests; they are *internal* tests that we use in our
development, made public by "popular demand".