[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: Best way to find out to what userdata is on the stack?
- From: Lothar Scholz <mailinglists@...>
- Date: Tue, 13 Mar 2007 18:45:40 -0800
Hello Enrico,
EC> Lothar Scholz wrote:
>> This is a newbies question: If i create multiple userdata objects,
>> what the best way to find out if that userdata pointer that i get from
>> the stack belongs to my "Foobar" c struct.
EC> A fast way could be packing an integer id together with the pointer in
EC> the userdata object (not a light userdata, which is just a pointer if I
EC> remember correctly).
What if somebody has this done in a library?
I can't access the userdata in any way before i'm not sure that it is
mine. Maybe somebody passed in a userdata of size 0 (possible?), so that
check would crash the app.
--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's