Re: nulling a userdata
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: nulling a userdata
- From: Sam Roberts <sroberts@...>
- Date: 2007年2月26日 16:45:15 -0800
On Mon, Feb 26, 2007 at 04:33:07PM -0800, Wesley Smith wrote:
> Is there a way from C that I can Null out a boxed pointer that has a
> reference to it as a userdata so that when I do lua_touserdata(L, -1)
> I will gett NULL? Or is this horrible design?
See lua's liolib.c, the function aux_close(), it does this to mark a
file as closed.
Sam