lua-users home
lua-l archive

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


>       char *luaL_prepstring (lua_State *L, size_t len);
> 	void lua_pushprepstring (lua_State *L, char *prepstring);

On occasion I have used lua_newuserdata as your luaL_prepstring and then
lua_pushstring as your lua_pushprepstring. This does involve double allocation
and copy but at least the boring parts (allocation and deallocation when an
error occurs) are handled by Lua.