[elephant-cvs] CVS elephant/src/elephant

ieslick ieslick at common-lisp.net
Wed Apr 4 15:28:29 UTC 2007


Update of /project/elephant/cvsroot/elephant/src/elephant
In directory clnet:/tmp/cvs-serv9316/src/elephant

Modified Files:
	migrate.lisp serializer2.lisp 
Added Files:
	gc.lisp 
Log Message:
Added support for complex serialization (no sorting), latest doc changes and a preliminary GC wrapper

--- /project/elephant/cvsroot/elephant/src/elephant/migrate.lisp	2007/03/24 10:49:59	1.13
+++ /project/elephant/cvsroot/elephant/src/elephant/migrate.lisp	2007/04/04 15:28:29	1.14
@@ -42,8 +42,9 @@
 ;; - Migrate keeps a memory-resident hash of all persistent objects;
 ;;   this is not as bad as it sounds as an object is only an oid reference 
 ;;   and a pointer to the store controller it belongs to.  However, you 
-;;   may eventually run out of heap space for very large DB's.  We can use
-;;   the old DB to store the mappings if this becomes a problem.
+;;   may eventually run out of heap space for very large DB's.  You can use
+;;   a third store controller to get around this by setting set-oid-spec to
+;;   a valid, uncreated store specification.
 ;;
 ;; - Each top-level call to migration will be good about keeping track
 ;;   of already copied persistent objects.  However the hash is not
--- /project/elephant/cvsroot/elephant/src/elephant/serializer2.lisp	2007/03/30 23:36:53	1.35
+++ /project/elephant/cvsroot/elephant/src/elephant/serializer2.lisp	2007/04/04 15:28:29	1.36
@@ -80,6 +80,7 @@
 (defconstant +array+                19)
 (defconstant +struct+               20)
 (defconstant +class+                21)
+(defconstant +complex+              22)
 
 ;; Lispworks support
 (defconstant +short-float+          30)
@@ -251,6 +252,10 @@
 	      (let ((pstring (namestring frob)))
 		(buffer-write-byte +pathname+ bs)
 		(serialize-string pstring bs)))
+	     (complex 
+	      (buffer-write-byte +complex+ bs)
+	      (%serialize (realpart frob))
+	      (%serialize (imagpart frob)))
 	     (hash-table
 	      (buffer-write-byte +hash-table+ bs)
 	      (let ((idp (gethash frob circularity-hash)))
@@ -459,6 +464,10 @@
 		      (setf (car c) (%deserialize bs))
 		      (setf (cdr c) (%deserialize bs))
 		      c))))
+	     ((= tag +complex+)
+	      (let ((rpart (%deserialize bs))
+		    (ipart (%deserialize bs)))
+		(complex rpart ipart)))
 	     ((= tag +hash-table+)
 	      (let* ((id (buffer-read-fixnum bs))
 		     (maybe-hash (lookup-id id)))

--- /project/elephant/cvsroot/elephant/src/elephant/gc.lisp	2007/04/04 15:28:29	NONE
+++ /project/elephant/cvsroot/elephant/src/elephant/gc.lisp	2007/04/04 15:28:29	1.1
(in-package :elephant)

(defgeneric stop-and-copy-gc (sc &key &allow-other-keys)
  (:documentation "Wrap all the migrate machinery in a
   simple top-level gc call.  This will copy all the data
   in the source store to the target store"))

(defmethod stop-and-copy-gc ((src store-controller) &key target mapspec replace-source delete-source)
  (when map-spec (set-oid-spec mapspec))
  (let ((target (gc-open-target sc target-spec))
	(src-spec (controller-spec src)))
    (migrate target src)
    (when map-spec 
      (set-oid-spec nil)
      (delete-spec mapspec))
    (when (or replace-source delete-source)
      (close-store src)
      (delete-spec src))
    (when replace-source
      (copy-spec source target))))

(defun delete-spec (spec)
  "Delete the storage associated with spec"
  )

(defun copy-spec (src targ)
  "Copy files associated with spec from src to targ"
  )





More information about the Elephant-cvs mailing list