[racket] making flvector with C API?

From: John Clements (clements at brinckerhoff.org)
Date: Thu Sep 29 12:26:36 EDT 2011

On Sep 28, 2011, at 7:31 PM, Jay Kominek wrote:

> I've got a little numerical routine in C that I'm calling from Racket;
> I started out with passing in normal vectors, but then I dug through
> the Racket source and found the macros necessary to handle flvectors,
> and switched to that. Seemed to speed things up. I'd like to finish
> the conversion, and return an flvector from my function, but there
> doesn't seem to be a "scheme_make_flvector", like
> "scheme_make_vector". Am I missing it? Does it have a different name?
> Can I kludge my way to it? Could it be added/exported? Do I not
> actually want to do this?
> 
> (I could of course modify in place an flvector provided by the caller,
> but that isn't as satisfying.)

Not actually answering your question, but would it perhaps be simplest to put a small Racket wrapper around the C function that creates the flvector? This would probably save you 5-10 lines of C and several opportunities for a core dump, as well. :)

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110929/1842498e/attachment.p7s>

Posted on the users mailing list.