[cffi-devel] null-pointer, *INLINE-EXPANSION-LIMIT* exceeded

Luís Oliveira luismbo at gmail.com
Thu May 22 01:59:55 UTC 2008


Hello Tamas,

On Sun, May 18, 2008 at 7:42 PM, Tamas K Papp <tpapp at princeton.edu> wrote:

> When compiling a function, I get this strange error message:
>
> ; in: DEFUN UMFPACK-SOLVE
> ;     (CFFI-SYS:NULL-POINTER)
> ;
> ; note: *INLINE-EXPANSION-LIMIT* (200) was exceeded, probably trying to
> ;   inline a recursive function.
>
> The code looks like this, it is in my cl-sparsematrix package
> (asdf-installable), cffi version is 20080217, using SBCL 1.0.16.0.
> The code looks like below, I tried to come up with a smaller example
> but couldn't (does not happen in one-liners using null-pointer).
> null-pointer does not look recursive to me...  umfpack-catch-error is
> a macro.  If there is something obvious I am doing wrong, please let
> me know, if not, helpful hints on how to determine what is going on
> are welcome.

Here's a smaller example:

    (defun foo ()
      (list . #.(loop repeat 200 collect '(cffi:null-pointer))))

Or, without CFFI:

   (declaim (inline a))
   (defun a () 0)
   (defun b () (list . #.(loop repeat 200 collect '(a))))

Notice that what you're getting is just a compiler note saying that it
has decided to not inline any more functions:

    CL-USER> (describe '*inline-expansion-limit*)
    *INLINE-EXPANSION-LIMIT* is an external symbol in #<PACKAGE "SB-EXT">.
    It is a special variable; its value is 200.
    Special documentation:
      an upper limit on the number of inline function calls that will
be expanded
      in any given code object (single function or block compilation)


So, I suppose that's what's going on with your code. You could
probably avoid that note by adding a (declare (notinline
null-pointer)) or binding *INLINE-EXPANSION-LIMIT* to a bigger number
while building your library. However, 200 inline expansions in one
function does seem like a lot at first sight; perhaps you should
investigate why that's happening.

HTH.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/



More information about the cffi-devel mailing list