Inline-SLang

 view release on metacpan or  search on metacpan

pdl.c  view on Meta::CPAN

  PDL->setdims( out, dims, at->num_dims );
#include "topdl.h"

  /*
   * copy the memory from the array since I don't know when S-Lang may delete it
   * (would be quicker to just point to it but that leads to memory-managment issues)
   *
   * It is not entirely clear to me from the S-Lang docs whether I can safely
   * access the data field of the array directly.
   */
  PDL->allocdata( out );
  (void) memcpy( out->data, at->data, (size_t) at->num_elements * dsize );

  /* covert the piddle into a 'SV *' */
  sv = sv_newmortal();
  PDL->SetSV_PDL( sv, out );
  SvREFCNT_inc( sv );
  return sv;

} /* sl2pl_array_pdl() */



( run in 0.600 second using v1.01-cache-2.11-cpan-454fe037f31 )