[Cffi-devel] What is wrong with this 2d array of pointers

Willem Rein Oudshoorn woudshoo at xs4all.nl
Sun May 11 09:05:20 UTC 2014


Joeish W <joeish80829 at yahoo.com> writes:

> I was hoping someone could look at this and help me debug it.
>
> I'm getting:
>
> (FOREIGN-ALLOC :POINTER :INITIAL-ELEMENT (NULL-POINTER))
> is not of type
> SB-SYS:SYSTEM-AREA-POINTER. when I run it.
>
>
>
> (foreign-array-alloc #2A((
>
> (foreign-alloc :pointer :initial-element (null-pointer)) 
> (foreign-alloc :pointer :initial-element (null-pointer))) 
> ((foreign-alloc :pointer :initial-element (null-pointer)) 
> (foreign-alloc :pointer :initial-element (null-pointer))) 
> ((foreign-alloc :pointer :initial-element (null-pointer)) 
> (foreign-alloc :pointer :initial-element (null-pointer))) 
> ((foreign-alloc :pointer :initial-element (null-pointer)) 
> (foreign-alloc :pointer :initial-element (null-pointer)))) '(:array :pointer 4 2))

A few points:

1. #2A(...) does not evaluate its content so the array consists of the
   unevaluated forms.
2. As far as I kno, foreign-array-alloc is not exported from CFFI, so
   you should not use them in your code.
3. C does not have two dimensional arrays anyway, so what are you trying todo?

Wim Oudshoorn.





More information about the cffi-devel mailing list