rif <[EMAIL PROTECTED]> writes: > * (system:int-sap (system:vector-sap a)) > > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: > #.(SYSTEM:INT-SAP #x4C7921F0) is not of type (UNSIGNED-BYTE 32) > > which makes sense, as a (describe 'system:int-sap indicates it wants > an integer). But then how does the example work? > > I also tried a call of the form (in my program) > > (system:vector-sap array) > > But this causes segmentation violations inside the called C function, > which I don't get if I allocate an alien object of the same size and > pass that. Any idea what to do?
You shouldn't need the call to SYSTEM:INT-SAP because SYSTEM:VECTOR-SAP already returns a system-area-pointer. As for the segmentation violation I don't know what's causing this. Here's a small example (which was part of CL-PDF before Marc moved to UFFI) which uses SYSTEM:VECTOR-SAP and works: <http://www.weitz.de/files/zlib-cmucl.lisp> (Actually, the original version used the ARRAY-DATA-ADDRESS stuff until J�rg-Cyril H�hle pointed out SYSTEM:VECTOR-SAP to me - which wasn't mentioned in my version of the CMUCL docs IIRC.) Cheers, Edi.
