lua-users home
lua-l archive

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


Soni,

I understand your confusion. From my point of view, the text starting with 'Lua implements...' is merely a description of how automatic memory management is done in the reference implementation of Lua and might not be considered a part of language specification (please correct me if I'm wrong). At least, I was experimenting with more HotSpot-like garbage collection approaches and they seemed to work just fine.
On the other hand, lua_gc and collectgarbage are standard library interfaces and they expose implementation details and I guess that if you want to build fully compliant platform you'll be forced to use mark-and-sweep...
I think that the piece of text that concerns you could be refactored if GC interfaces were removed from standard library, which actually makes some sense to me. 

Best regards,
Igor A. Ehrlich

On Thu, Jun 4, 2015 at 10:08 PM, Soni L. <fakedme@gmail.com> wrote:


On 04/06/15 04:02 PM, Dirk Laurie wrote:
2015-06-04 20:53 GMT+02:00 Soni L. <fakedme@gmail.com>:
http://www.lua.org/manual/5.3/manual.html#2.5

Why does the Lua reference manual require a specific garbage collector
implementation? Surely just having functionality requirements for the GC is
enough, no? (e.g. must support __gc and weak tables and stuff)
It does not "require" a specific collector. It merely says what is there:
an incremental mark-and-sweep collector.

The reference manual is what your implementation should follow. It essentially requires your implementation to have a specific garbage collector for it to comply with the manual.


--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.





--
Best regards,
Igor A. Ehrlich