lua-users home
lua-l archive

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


Actually this idea will not work as possible cyclical references would not be collected as it's pointed by other posters. 

Alex

>-----Original Message-----
>From: Bilyk, Alex [mailto:ABilyk@maxis.com]
>Sent: Wednesday, June 09, 2004 5:40 PM
>To: Lua list
>Subject: RE: Feature request: more integration of Lua and C memory
>management

>
>
>The idea of using an array of objects associated with user 
>data can be implemented via a table. Just create a vector 
>table, get a reference to it and store that reference in 
>userdata. On userdata GC you would either release this table's 
>reference or clean it up if there is a need to pool such 
>tables for reuse.
>