[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANNOUNCE] Lua 5.0 (alpha) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 16 Aug 2002 07:37:52 -0300
>That's good! But, what if you want to resize the data block pointed to?
You'll have to manage it yourself: create a new userdata and copy the old
contents to the new buffer.
>Wouldn't a void * lua_resizeuserdata(lua_State *L, void *ptr, size_t size)
>come in handy then?
Perhaps, but it would have to be "int index" instead of "void *ptr", that is,
it would to receive a Lua object to resize, not a pointer. The pointer is
returned by lua_newuserdata just so you can fill the buffer, but the main
value is the whole userdata value that lua_newuserdata also leaves on the stack.