Re: sbcl and uffi functions that return :pointer-void
Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Fri, 11 Mar 2005 07:43:18 -0700
| Newsgroups | gmane.lisp.uffi.devel |
|---|---|
| Message-ID | <[email protected]> |
Cyrus Harmon wrote: > I know there's been some discussion of how to avoid runtime allocation > on SBCL for UFFI memory access, but I'm trying to declare an UFFI > function that returns a :pointer-void and I get a warning about runtime > allocation. Declaring the return type as :int makes the warning go > away, but this is, of course, not the right answer. Is there a way to > do this without the runtime allocation? Not every runtime allocation warning causes SBCL/CMUCL to have horrible performance. I've not tested with a function returning :pointer-void, but typically that wouldn't cause a problem. The runtime problem with SBCL/CMUCL is when you'd want to cast that pointer to another type. What are you planning on doing with the return value? Just passing back to a foreign function, or casting and dereferencing? If it's the first, have you tested if there really is a performance problem [it'll be easy to see if it is]. In the latter case, SBCL/CMUCL have serious trouble with this and you and I have exchanged email before how to try to work around that. -- Kevin Rosenberg kevin-HJRc7zDS/[email protected]