Re: gethostname example: trying to avoid superfluous alloc+free

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Thu, 21 Mar 2002 12:51:56 -0700 (MST)
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
> Actually, I'd like to point out that using alloc+free foreign strings is
> far away from the most efficient implementation on CMUCL (and CLISP
> which is not supported).

I've added a benchmark directory to UFFI. The first file there tests
native allocation modes for an integer and a vector of integer.
With ACL, static allocation is a big win, for LW stack is twice the
speed of static, and for CMUCL stack is many times the speed of static.

I've specialized with-foreign-object(s) so that it uses stack allocation
on LW and CMUCL and static for ACL.

One criteria is that UFFI code is valid in all implementations. I expect
I would translate with-foreign-object to CLISP code. But, I still wonder
if I can translate the low level interface to CLISP.

Kevin