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/06/27 17:59:16 UTC

[GitHub] sergeykolychev commented on a change in pull request #11414: MXNET-336 [Perl] Major Gluon update for Perl API.

sergeykolychev commented on a change in pull request #11414: MXNET-336 [Perl] Major Gluon update for Perl API.
URL: https://github.com/apache/incubator-mxnet/pull/11414#discussion_r198587947
 
 

 ##########
 File path: perl-package/AI-MXNetCAPI/mxnet_typemaps.i
 ##########
 @@ -300,6 +302,37 @@
     Safefree($1);
 }
 
+%typemap(in) (dim_t *in)
+{
+    AV *tempav;
+    int i;
+    SV  **tv;
+    int av_len; 
+    if (!SvROK($input))
+        croak("Argument $argnum is not a reference.");
+        if (SvTYPE(SvRV($input)) != SVt_PVAV)
+        croak("Argument $argnum is not an array.");
+        tempav = (AV*)SvRV($input);
+    av_len = av_len(tempav) + 1;
+    if(av_len)
+    {
+        $1 = (dim_t *)safemalloc(av_len*sizeof(dim_t));
 
 Review comment:
   Ok, thanks for this observation, I'll cleanup safemalloc usage up in future, need to verify it's present in all perls from 5.14 till 5.28

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