Comment out some more free() calls, which need to be turned on per-subsystem to weed...
[Math-GSL.git] / swig / NTuple.i
blobddeb182fc0def399cd766c054aaf4e70e7932ca4
1 %module "Math::GSL::NTuple"
2 %include "typemaps.i"
3 %include "gsl_typemaps.i"
5 // XXX: This needs to properly take the type of array into account,
6 // this assumes ints
7 %typemap(in) void *ntuple_data {
8 AV *tempav;
9 I32 len;
10 int i;
11 SV **tv;
13 //fprintf(stderr,"symname=$symname \n");
15 if (!SvROK($input))
16 croak("Math::GSL::NTuple : $1_name is not a reference!");
18 if (SvTYPE(SvRV($input)) != SVt_PVAV)
19 croak("Math::GSL::NTuple : $1_name is not an array ref!");
21 tempav = (AV*)SvRV($input);
22 len = av_len(tempav);
23 if( len > 0 ){
24 $1 = (int **) malloc((len+1)*sizeof(int *));
25 for (i = 0; i <= len; i++) {
26 tv = av_fetch(tempav, i, 0);
27 memset((int*)($1+i), SvIV(*tv) , sizeof(int *));
32 %typemap(argout) void *ntuple_data {
33 //Perl_sv_dump($1);
36 %typemap(freearg) void *ntuple_data {
37 // if ($1) free($1);
41 #include "gsl/gsl_ntuple.h"
42 #include "gsl/gsl_errno.h"
43 #include "gsl/gsl_histogram.h"
46 %include "gsl/gsl_ntuple.h"
47 %include "gsl/gsl_histogram.h"
49 %include "../pod/NTuple.pod"