[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is this Lua table an array?
- From: Doug Currie <doug.currie@...>
- Date: Thu, 5 Oct 2006 12:23:20 -0400
Thursday, October 5, 2006, 11:32:30 AM, David Jones wrote:
> On 5 Oct 2006, at 16:00, Doug Currie wrote:
>> Thursday, October 5, 2006, 6:18:43 AM, David Jones wrote:
>>
>>> lua_tostring _has_ to modify the stack argument in order to keep the
>>> GC happy.
>>
>> Well, it _could_ create a global weak reference to the string instead.
> No, because without a strong reference to the string the GC would be
> at liberty to free the string and thereby invalidate the pointer that
> you just got back from lua_tostring in the C world.
You're right, of course. I was groping for a way to make a reference
to the string that was weak on the activation frame; but since those
frames aren't Lua objects (no call/cc in Lua) that won't work.
Sorry for the noise.
e
--
Doug Currie
Londonderry, NH