Invalidate / GC-marking after close of large data blocks
bil til <[email protected]>
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <CAOnDXmEq16UkL=zQqobv6_JoPV+ARCaHrj+xJ6OvJXPt2Y8NeQ@mail.gmail.com> |
In my C software it happens from time to time, that e. g. some larger
block of userdata expired / is closed.
It would be nice, if this then is recognized by the gc as fast as possible.
Currently, I then invoke:
lua_gc( L, LUA_GCCOLLECT);
This works I think, just for runtime predictions this might be a BIT
dangerous - as such a GCCOLLECT run will have to check the complete
global table, it might need quite a time in larger applications, I
think.
Generally, I think it might be more efficient, and nice concerning
runtime predictions for many applications, if there would be a
possiblity, that GC would just "eat the last element on stack and mark
it free", so e. g. invoke like:
lua_gc(L, LUA_GCCOLLECT_TOPOFSTACK);
... or similar command... .
What do you think about this?
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAOnDXmEq16UkL%3DzQqobv6_JoPV%2BARCaHrj%2BxJ6OvJXPt2Y8NeQ%40mail.gmail.com.