[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: GC and userdata mark and sweep
- From: Benjamin Legros <legros@...>
- Date: Mon, 1 Jun 2009 13:16:50 +0200
Thanks everyone for your suggestions!
I understand the concept of using userdata environment table. Yet I have some concerns about it:
- I doubt that exploring the userdata environment through the C api provides sufficient gains -- scripted lua is probably doing a much better job
- Keeping pointers on userdata + references on userdata through userdata env will help improving perfs at the cost of doubling memory consumption -- well I can afford some more bytes
I have experienced a bit with Peter's tweak, and it seems to work. I'll run a monkey for a day or two and would anything go awry, I'll switch to keeping refs both in userdata and environment.
For what it's worth, the patch is pretty straight forward and contains a few dozens lines -- thanks to the lua code being incredibly small!