[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hi and pushing existing UserData from pointer
- From: Chris Camacho <c.camacho@...>
- Date: Mon, 17 Aug 2009 22:44:44 +0100
The most elegant solution is to have a weak table in the registry, as
proposed earlier by Tony Finch. You can have your userdata constructor
function put them there, and not care about that table thereafter,
just use it to convert a light userdata to a full userdata.
slight problem... when I create the user data on the stack
if I pop it off to save it to a table there's no way to push
userdata onto the stack
How would I "peek" into the stack and save the new userdata
without disturbing the values I'm assembling on the stack for
the return?
Thanks for explaining lightuserdata metatables in a clearer manner,
although I have 8 or more types wrapped this is the first time I've
had to return a reference to existing userdata and what a PITA it is!
thanks
Chris
--
Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:
1. I am by definition, "the intended recipient"
2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it lends
itself to. In particular, I may quote it where I please.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
may be included on your message.