[Ecls-list] foreign data arrays and vectors
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Thu Dec 14 15:49:14 UTC 2006
2006/12/14, Brian Spilsbury <brian.spilsbury at gmail.com>:
> The diff included illustrates a technique for making arrays and
> vectors which address foreign data, along with some example code.
Looks good. The MAKE-FOREIGN-VECTOR is redundand, though. It would
suffice allowing MAKE-FOREIGN-ARRAY take either a list or a number,
like MAKE-ARRAY already does.
> The main point of allowing arrays and vectors upon foreign data is to
> access C data without copying it, and while retaining the ability to
> use normal array operations (the arrays and vectors are currently not
> permitted to be adjustable).
Only the second point is justified. The foreign operations should be
able of accessing foreign data with the elementary types your patch
allows (float, integers, chars, etc), and also more complex C types
(for those one can get a pointer reference, avoiding copies).
> If this seems like a good idea, then I'll look at a cleaner
> implementation to submit as patch (unless someone else wants to). If
> not, I'd like to know why.
Feel free to work on it. Regarding GC, the user should take care of
that or add a finalizer to the array.
Dpto. de Fisica Teorica I, Fac. de CC Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 2804 (Spain)
More information about the ecl-devel