Mon, 4 Dec 2000 04:15:28 -0800, Simon Marlow <[EMAIL PROTECTED]> pisze:
> Ok, so the malloc/free is the most expensive part. I'm moderately
> surprised:) Perhaps we could do a better job, but we'll never do
> better than ByteArrays as long as the bracket is required.
BTW, withCString in my implementation which handles charsets does not
use alloca but malloc. It's because we don't know the length of the
resulting char[] until we convert it, so we cannot preallocate it.
We must guess an initial size and realloc the array as needed.
Hence unfortunately speeding up alloca won't speed my implementation
of the common need of allocating C objects.
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZAST�PCZA
QRCZAK
_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi