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 14:47:42 UTC

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

tlby 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_r208260635
 
 

 ##########
 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:
   I suspect you had to do this because  you found`$input` was getting freed?  newSVsv() will return a copy with a refcount of 1 preventing that, but `SvREFCNT_inc($input)` would likely have worked here as well with less effort.  But in both cases, we probably need an `SvREFCNT_dec(...)` somewhere to avoid a (small) memory leak. 

----------------------------------------------------------------
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