lua-users home
lua-l archive

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


see your right..

lua_pushlightuserdata(L, v);
lua_pushvalue(L, 1);

would be a better idea, that way your not creating a userdata every time the
function gets called
thanks 4 that..


----- Original Message -----
From: "Peter Shook" <pshook@sympatico.ca>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Wednesday, May 14, 2003 1:06 AM
Subject: Re: on the topic of userdata


>
> The new lua-l doesn't seem as responsive as the old one.  Should we
> still be using the old list, or can we start using the new one?
>
>
> To answer the userdata question:
>
> It's important to remember that lua_newuserdata is just a wrapper around
> some form or malloc.  You have take a stance on who will keep track of
> the memory resouces being used: either Lua or C/C++.  If you let Lua
> malloc some memory for the structure, you need to be careful with your
> copy constructors and assignment operators in C++.  You may be better
> off just putting a pointer to your C++ object in the userdata.
>
> - Peter Shook
>
> Lava_Monkey wrote:
>  > ah crap i answered my own question.. its always the way..
>  > anyway here what i did, maybe its evil in some way please feel free to
>  > correct it..
>  >
>
>