This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Behind the scenes of uniform arrays?



>From everything I've seen in documentation and source, uniform arrays
in Guile and SCM are C arrays with some bookkeeping information at the
front and a set of access routines.  The advantage cited in the
documentation is that these arrays take less space than conventional
vectors, but surely they are also designed for efficiency and
interoperability purposes, as well?

Given a uniform array, I want to obtain a pointer to the actual array
and pass it to a C function which is expecting something of type
X*, where X is one of char, short, long, float, double, etc.

However, I only want to do this if it is considered to be one of the
supported operations.  Is there, and will there always be, a way to
get a C pointer to this array, and will the array always be
identically to the C types char*, short*, etc.

I'm assuming, of course, that this will happen in an external routine,
not in Scheme.  That is, I have a external function written in C which
accepts uniform arrays, extracts the pointer, then passes it on to
another C routine from some library.

Cliff

-- 
Clifford Beshers                     Computer Graphics and User Interfaces Lab
beshers@cs.columbia.edu                         Department of Computer Science
http://www.cs.columbia.edu/~beshers                        Columbia University