From d6a062d9765e341ce66979967f94918aceb45fd3 Mon Sep 17 00:00:00 2001 From: Jonathan Leto Date: Wed, 21 May 2008 19:04:10 -0400 Subject: [PATCH] Experiments with typemaps. --- Randist.i | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Randist.i b/Randist.i index 56751b9..722a70e 100644 --- a/Randist.i +++ b/Randist.i @@ -6,7 +6,6 @@ I32 len; int i; SV **tv; - //printf("FOO\n"); if (!SvROK($input)) croak("Argument $argnum is not a reference."); @@ -15,12 +14,15 @@ tempav = (AV*)SvRV($input); len = av_len(tempav); - $1 = (void **) malloc((len+2)*sizeof(int *)); + $1 = (int **) malloc((len+2)*sizeof(int *)); for (i = 0; i <= len; i++) { tv = av_fetch(tempav, i, 0); - // $1[i] = (int *) SvIV(*tv); + //$1[i] = (int) SvIV(*tv); } }; +%typemap(freearg) void * { + free($1); +} %{ #include "/usr/local/include/gsl/gsl_randist.h" -- 2.11.4.GIT