in reply to PerlXS typemap and reference counting
Are you saying that when you call new() from Perl code (something like):
use Grpc::XS::Call; use Grpc::XS::Channel; use Grpc::XS::Timeval; my $timeval = Grpc::XS::Timeval->new( ... ); my $channel = Grpc::XS::Channel->new( ... ); my $call = Grpc::XS::Call->new( $channel, $timeval ); ...
by the time the values arrive in your XS code, they are out of scope?
If so, then the likelihood is that they have already been GC'd before you call the constructor (easily checked) and the problem lies in your Timeval & Channel constructors.
You can manually increment the reference count using SvREFCNT_inc or its optimised variants; but be sure that you don't render them immortal and create a memory leak.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PerlXS typemap and reference counting
by joyrex2001 (Initiate) on Apr 24, 2016 at 09:24 UTC | |
by syphilis (Archbishop) on Apr 24, 2016 at 11:33 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2016 at 12:27 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2016 at 12:51 UTC | |
by joyrex2001 (Initiate) on Apr 24, 2016 at 16:02 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2016 at 16:26 UTC | |
by Anonymous Monk on Apr 24, 2016 at 09:29 UTC |