You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/07 16:57:11 UTC

[GitHub] sergeykolychev commented on a change in pull request #12038: MXNET-776 [Perl] Better documentation/bug fixes.

sergeykolychev commented on a change in pull request #12038: MXNET-776 [Perl] Better documentation/bug fixes.
URL: https://github.com/apache/incubator-mxnet/pull/12038#discussion_r208307874
 
 

 ##########
 File path: perl-package/AI-MXNetCAPI/mxnet_typemaps.i
 ##########
 @@ -1215,5 +1215,5 @@
 
 %typemap(in) (void* callback_handle)
 {
-    $1 = (void*)$input;
+    $1 = (void*)newSVsv($input);
 
 Review comment:
   This was interesting case. It's related to the call backs for the kvstore and the montitor.
   The things worked with XS Mouse but when I tried pure perl Mouse the subs that were expected to persists by the swig side were somehow freed on the Perl level.
   The reason of the freeing was unclear to me, as I still kept the references to these subs in specifically created for this case mouse accessors.
   
   In any case I have changed the code and now not keeping these subs in perl space at all (the accessors had been removed), so essentially swig copies these subs and keeps them.
   
   ```SvREFCNT_inc``` would have worked here as well, probably, but I went with the way that's recommended in the perlapi.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services