Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 3 > Wrapping C arra...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 93 of 148
Post > Topic >>

Wrapping C arrays

by Henning Thielemann <iakd0@[EMAIL PROTECTED] > Apr 13, 2004 at 03:09 PM

When working on wrappers for the FFTW library I encountered several
problems that may require some sort of hacks ...

1. How to wrap an open C array with fix dimensionality by a Modula-3
array? 

 libfftw provides a function to allocate memory at SIMD friendly memory
locations. I like to use this function and wrap the pointer to the C array
by a Modula-3 open array. It would be nice if this array could also be
traced by the Garbage collector. Of course I want to use as little
knowledge about the internals of open arrays as possible, so I searched
the RT (runtime) modules of m3core for a function that does the wrapping. 
But I didn't found one. 

2. How to handle arrays of arbitrary dimensions?

 The functions RTType.GetNDimensions and RTHeap.GetArrayShape let me hope
that it is possible to manage arrays of arbitrary dimension by REFANY
arguments. But how can I check the index and field type of an ARRAY type?
How to wrap the allocation function described above to work with arrays of
arbitrary dimension? I think the wrapper needs a TypeCode argument to be
able to create arrays of a type that the main program knows of.




 2 Posts in Topic:
Wrapping C arrays
Henning Thielemann <ia  2004-04-13 15:09:11 
Re: Wrapping C arrays
"Rodney M. Bates&quo  2004-04-14 16:22:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 21:47:58 CDT 2008.