Sorry but I don't finish the problem,
The c header:
low.h
double* low(double *x, double *y,int size);
______________________________________________________________
The c file
low.c
double* low(double *x, double *y,int size){
double *ys;
ys = (double *) malloc( (size) * sizeof(double));
clow(x, y,size,ys);
free(x); free(y);
return ys;
}
______________________________________________________________________
The java interface
iLow.java
public interface iLow extends Library{
iLow INSTANCE = (iLow)Native.loadLibrary("low", iLow.class);
Pointer low( double[] x, double[] y,int size);
}
________________________________________________________________________
My java class
myclass.java
...
iLow Lib = iLow.INSTANCE;
Pointer P =new Memory((D.length) * Double.SIZE);
P= Lib.low(D,R, D.length);
L = P.getDoubleArray(0,D.length);
P=null;
...
____________________________________________________________________________
I've done test and myclass.java calls to the function correctly. The
function works correctly,but what the library return produces the known
error.
By the way;
In my C code: sizeof(double)=8 and
In my Java code: Double.SIZE=64
Thanks in advance.