lua-users home
lua-l archive

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


>>>>> "Bilyk," == Bilyk, Alex <ABilyk@maxis.com> writes:

    Bilyk,> Lua5 manual states that user data objects are collected in
    Bilyk,> the order reverse to that of their creation. It, however,
    Bilyk,> doesn't say anything about the order of GC in
    Bilyk,> general. Hence, given two arbitrary Lua objects O1 and O2,
    Bilyk,> can assumption be made that O1 is destroyed after O2 if it
    Bilyk,> was created before O2 and vice versa?


Even if the current implementation enforces this, I think that you
should not expect this in all cases. Imagine another Lua
implementation (and such beast exist, e.g. the lua interpeter coded
in Ocaml inside QuickC-- see www.cminusminus.org for more). Then it
probably won't have the same destruction order than the original Lua.

In GC-ed implementations, destructions can occur at any time (or even
not at all: consider an execution so quick that no GC is needed at
all!)

-- 

Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France