implementation independent sb-sys:system-area-pointer

Discussion of Common Lisp

implementation independent sb-sys:system-area-pointer

Postby joeish80829 » Sun Apr 13, 2014 8:39 am

I have this trivial garbage finalizer I'm using to automatically callm y del-mat function
which basically calls delete on the new that is created in the function my %mat
function wraps(not shown). I was told by someone at cffi-devel that

" You use sb-sys:system-area-pointer as type, and this will tie you to
SBCL. There is no reason for that.
"
How would I change the sb-sys:system-area-pointer type in the below code to make it
compatible with all implementations. I could use a concrete example based on the
below code since I'm still kind of new to this part of CFFI.Thanks in advance for
any help on this
Code: Select all
(defstruct (cvmatrix (:constructor %make-cvmatrix))
   (sap (%mat) :type sb-sys:system-area-pointer :read-only t))
 
  (defun make-cvmatrix (&optional enable-finalizer)
   (let* ((matrix (%make-cvmatrix))
           (sap (cvmatrix-sap matrix)))
 (when enable-finalizer
     (tg:finalize matrix (lambda () (del-mat sap))))
     sap))
joeish80829
 
Posts: 153
Joined: Tue Sep 03, 2013 5:32 am

Return to Common Lisp

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests