Commit 22e43aff authored by Liam Healy's avatar Liam Healy
Browse files

No finalizers in faify-form (array callbacks); add dependencies

parent ebd23bf3
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2010-07-07 09:55:58EDT gsll.asd>
;; Time-stamp: <2010-07-13 21:07:57EDT gsll.asd>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -36,8 +36,8 @@
:components
((:file "init")
(cffi-grovel:grovel-file "libgsl" :pathname #+unix "libgsl-unix")
(:file "utility")
(:file "forms")
(:file "utility" :depends-on ("init"))
(:file "forms" :depends-on ("init"))
(:file "conditions" :depends-on ("init" "libgsl"))
(:file "callback-compile-defs" :depends-on ("init"))
(:file "mobject" :depends-on ("init" "callback-compile-defs"))
......@@ -49,15 +49,15 @@
(:file "types" :depends-on ("init" "libgsl"))
(cffi-grovel:grovel-file "callback-struct"
:depends-on ("types" "libgsl"))
(:file "funcallable" :depends-on ("utility"))
(:file "funcallable" :depends-on ("init" "utility"))
(:file "interface"
:depends-on ("init" "conditions"))
(:file "defmfun" :depends-on ("init" "forms" "interface"))
(:file "defmfun-array"
:depends-on ("defmfun" "callback-included"))
:depends-on ("init" "defmfun" "callback-included"))
(:file "defmfun-single"
:depends-on ("defmfun" "mobject" "callback"))
(:file "body-expand" :depends-on ("defmfun" "mobject" "callback"))
:depends-on ("init" "defmfun" "mobject" "callback"))
(:file "body-expand" :depends-on ("init" "defmfun" "mobject" "callback"))
(:file "generate-examples" :depends-on ("init"))))
(:module floating-point
:depends-on (init)
......
;; Generate a lambda that calls the user function; will be called by callback.
;; Liam Healy
;; Time-stamp: <2010-07-13 12:06:01EDT funcallable.lisp>
;; Time-stamp: <2010-07-13 21:05:37EDT funcallable.lisp>
;;
;; Copyright 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -63,19 +63,20 @@
(defun faify-form (ptr argspec)
"Make the form that turns the mpointer into a foreign-array."
;; No finalizer, because pointer might be reused by GSL.
(ecase (parse-callback-argspec argspec 'array-type)
(:foreign-array ; a GSL mpointer
`(make-foreign-array-from-mpointer
,ptr
',(grid:cffi-cl (parse-callback-argspec argspec 'element-type))
,(length (parse-callback-argspec argspec 'dimensions))
t))
nil)) ; no finalizer
(:cvector ; a raw C vector
`(grid:make-foreign-array-from-pointer
,ptr
',(parse-callback-argspec argspec 'dimensions)
',(grid:cffi-cl (parse-callback-argspec argspec 'element-type))
t))))
nil))))
;;;;****************************************************************************
;;;; Reference foreign elements and make multiple-value-bind form
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment