joyrex2001 has asked for the wisdom of the Perl Monks concerning the following question:
In the call constructor, I pass both a Channel and Timeval instance, see:Grpc::XS::Call T_PTROBJ Grpc::XS::Channel T_PTROBJ Grpc::XS::Timeval T_PTROBJ
When the constructor is called, the timeval object is already out-of-scope, and gets dereferenced by perl. However, this is actually not correct, since it's only out of scope in perl, not in my xs scope.Grpc::XS::Call new(const char *class, Grpc::XS::Channel channel, \ const char* method, Grpc::XS::Timeval deadline, ... ) PREINIT: CallCTX* ctx = (CallCTX *)malloc( sizeof(CallCTX) ); ctx->wrapped = NULL; CODE: ## some code removed ## ctx->wrapped = grpc_channel_create_call( channel->wrapped, NULL, GRPC_PROPAGATE_DEFAULTS, completion_queue, method, host_override, deadline->wrapped, NULL); RETVAL = ctx; OUTPUT: RETVAL
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PerlXS typemap and reference counting
by BrowserUk (Patriarch) on Apr 23, 2016 at 22:50 UTC | |
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 |