Need foreign string method for translate-into-foreign-memory?

Luís Oliveira loliveira at common-lisp.net
Sat Oct 12 10:52:37 UTC 2013


On Wed, Oct 9, 2013 at 4:35 AM, Liam Healy <lnp at healy.washington.dc.us> wrote:
> I've pushed the rewrite; please take a look and run tests to see
> that it's good. I've temporarily created a new branch foreign-string.

This refactorization is trickier than it might seem. You cannot pass
the string to the octet-counter without performing the
with-checked-simple-vector adjustments beforehand. Also, this version
doesn't take into account the null terminator when computing the right
bound of the buffer.

I'd start over and try to extract the encoder funcall and the null
terminator loop, make sure that works, and then try to figure out
what's the next lowest hanging fruit.

Cheers,

-- 
Luís Oliveira
http://kerno.org/~luis/



More information about the cffi-devel mailing list