Support modular smoke & cleanup.
src/bindings.lisp
Sun Jan 10 09:49:36 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support modular smoke & cleanup.
--- old-smoke/src/bindings.lisp 2014-10-30 08:09:07.000000000 +0100
+++ new-smoke/src/bindings.lisp 2014-10-30 08:09:07.000000000 +0100
@@ -1,27 +1,5 @@
(in-package :smoke)
-(defvar *bindings* (make-hash-table)
- "The Smoke C++ binding classes to which virtual method calls are dispatched.")
-
-;; FIXME is this lock needed? (The user may not have to
-;; load additional modules while threads are running.
-(defvar *bindings-lock* (make-lock "bindings-lock"))
-
-(defun binding (smoke)
- "Returns the Smoke binding for the Smoke module SMOKE."
- (with-lock-held (*bindings-lock*)
- (multiple-value-bind (value present-p)
- (gethash (pointer-address smoke) *bindings*)
- (assert (eql t present-p)
- ()
- "No binding for ~A." smoke)
- value)))
-
-(defun (setf binding) (binding smoke)
- (with-lock-held (*bindings-lock*)
- (setf (gethash (pointer-address smoke) *bindings*)
- binding)))
-
(defstruct smoke-array
"A C array."
(pointer (null-pointer) :type foreign-pointer)
@@ -45,6 +23,9 @@
(defvar *smoke-modules* (make-hash-table)
"All loaded Smoke modules.")
+(eval-on-save ()
+ (clrhash *smoke-modules*))
+
(defmethod print-object ((smoke-module smoke-module) stream)
(if (null-pointer-p (smoke-module-pointer smoke-module))
(call-next-method)