sriniiyer has asked for the wisdom of the Perl Monks concerning the following question:
This is in continuation to the question that I asked in Callback function in xsubpp. While writing another function in a xsubpp program, I wrote something like this:
HV *data_hash = newHV(); /* do some processing here. */ call_perl_sub("test_callback", SvREFCNT_inc(data_hash));
Here the function call_perl_sub() and subroutine test_callback are same as the one given in Callback function in xsubpp. However, when the callback is executed, it doesn't pass the reference to the data_hash that I passed to the callback subroutine and gives me the Bizarre copy of HASH error.
I checked the reference counts using SvREFCNT(data_hash) and found to be correct. Is there something that I am missing while passing it to the callback?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Not able to pass the hash reference to callback from xsubpp
by ikegami (Patriarch) on Aug 13, 2013 at 13:36 UTC | |
by sriniiyer (Initiate) on Aug 13, 2013 at 15:56 UTC | |
Re: Not able to pass the hash reference to callback from xsubpp
by Anonymous Monk on Aug 13, 2013 at 12:23 UTC |
Back to
Seekers of Perl Wisdom