in reply to Re^9: odd line in windows
in thread odd line in windows
I stand corrected. The code in the recipe is actually correct.
SV* obj_ref = newSViv(0); SV* obj = newSVrv(obj_ref, class);
newSVrv doesn't create a reference as a I had guessed, it returns a new SV and makes obj_ref a reference to it. WTF? How odd is that!!!
So obj_ref holds a reference to the blessed scalar in obj, which in turn contains an integer which corresponds to the memory address of the C object.
set_iv is not being used on the reference, so there are no issues wrt to recent changes in scalar types.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: odd line in windows
by BrowserUk (Patriarch) on Sep 08, 2011 at 22:29 UTC | |
by ikegami (Patriarch) on Sep 08, 2011 at 22:50 UTC | |
by BrowserUk (Patriarch) on Sep 08, 2011 at 23:15 UTC | |
by syphilis (Archbishop) on Feb 20, 2014 at 11:30 UTC |