Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 3, 2008, 12:24 am
rate this thread
my @arr = (1,2,3);
in XS code
SV * sv = ST(0);
// get the memory address of this array reference and save it,
How do I get the memory address of \@arr in xs_test? Will the content
in that address change when exiting the xs_test function? Thanks.
- Joost Diepenmaat
November 3, 2008, 12:36 pm
Re: How to get the memory address of a Perl variable in XS
What do you mean? That /is/ what you're doing.
void* address = (void*) sv;
That's always possible, but you probably should at least increment the
refcount on sv if you're planning on keeping it around.
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl /
- » A couple of questions regarding runtime generation of REGEXP's
- — Previous thread in » PERL Discussions