Skip to content
Snippets Groups Projects
Commit 22e43aff authored by Liam Healy's avatar Liam Healy
Browse files

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

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