[rucksack-cvs] CVS rucksack

charmon charmon at common-lisp.net
Tue Jan 16 08:57:44 UTC 2007


Update of /project/rucksack/cvsroot/rucksack
In directory clnet:/tmp/cvs-serv24724

Modified Files:
	garbage-collector.lisp rucksack.asd rucksack.lisp 
	transactions.lisp 
Log Message:
rucksack 0.1.4
 * add new parameter *collect-garbage-on-commit*
 * add (:inhibit-gc nil) keyword arg to with-transaction
 * add without-rucksack-gcing macro
 * only collect garbage on transaction-commit when
   *collect-garbage-on-commit* is not nil


--- /project/rucksack/cvsroot/rucksack/garbage-collector.lisp	2006/09/04 12:34:34	1.19
+++ /project/rucksack/cvsroot/rucksack/garbage-collector.lisp	2007/01/16 08:57:43	1.20
@@ -1,4 +1,4 @@
-;; $Id: garbage-collector.lisp,v 1.19 2006/09/04 12:34:34 alemmens Exp $
+;; $Id: garbage-collector.lisp,v 1.20 2007/01/16 08:57:43 charmon Exp $
 
 (in-package :rucksack)
 
@@ -446,6 +446,14 @@
     work-done))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;              
+;;; Parameters to control GC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defparameter *collect-garbage-on-commit* t
+  "A flag to indicate whether or not transaction-commit collects garbage")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;              
 ;;; MAYBE LATER: MERGING DEAD BLOCKS.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
--- /project/rucksack/cvsroot/rucksack/rucksack.asd	2007/01/16 08:47:36	1.5
+++ /project/rucksack/cvsroot/rucksack/rucksack.asd	2007/01/16 08:57:43	1.6
@@ -1,9 +1,9 @@
-;;; $Id: rucksack.asd,v 1.5 2007/01/16 08:47:36 charmon Exp $
+;;; $Id: rucksack.asd,v 1.6 2007/01/16 08:57:43 charmon Exp $
 
 (in-package :cl-user)
 
 (asdf:defsystem :rucksack
-  :version "0.1.3"
+  :version "0.1.4"
   :serial t
   :components ((:file "queue")
                (:file "package")
--- /project/rucksack/cvsroot/rucksack/rucksack.lisp	2006/11/30 10:45:34	1.17
+++ /project/rucksack/cvsroot/rucksack/rucksack.lisp	2007/01/16 08:57:43	1.18
@@ -1,4 +1,4 @@
-;; $Id: rucksack.lisp,v 1.17 2006/11/30 10:45:34 alemmens Exp $
+;; $Id: rucksack.lisp,v 1.18 2007/01/16 08:57:43 charmon Exp $
 
 (in-package :rucksack)
 
@@ -238,13 +238,18 @@
   "The currently active transaction.")
  
 (defmacro with-transaction ((&rest args
-                             &key (rucksack '(current-rucksack))
+                             &key
+                             (rucksack '(current-rucksack))
+                             (inhibit-gc nil inhibit-gc-supplied-p)
                              &allow-other-keys)
                             &body body)
   (let ((committed (gensym "COMMITTED"))
         (transaction (gensym "TRANSACTION"))
         (result (gensym "RESULT")))
-    `(let ((,transaction nil))       
+    `(let ((,transaction nil)
+           (*collect-garbage-on-commit* (if ,inhibit-gc-supplied-p
+                                            ,(not inhibit-gc)
+                                            *collect-garbage-on-commit*)))
        (loop named ,transaction do         
           (with-simple-restart (retry "Retry ~S" ,transaction)
             (let ((,committed nil)
--- /project/rucksack/cvsroot/rucksack/transactions.lisp	2006/08/24 15:21:25	1.11
+++ /project/rucksack/cvsroot/rucksack/transactions.lisp	2007/01/16 08:57:43	1.12
@@ -1,4 +1,4 @@
-;; $Id: transactions.lisp,v 1.11 2006/08/24 15:21:25 alemmens Exp $
+;; $Id: transactions.lisp,v 1.12 2007/01/16 08:57:43 charmon Exp $
 
 (in-package :rucksack)
 
@@ -171,6 +171,13 @@
 ;; Committing a transaction
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+;;; use without-rucksack-gcing to locally set
+;;; *collect-garbage-on-commit* to nil in order to supress rucksack
+;;; garbage collection on commit
+(defmacro without-rucksack-gcing (&body body)
+  `(let ((*collect-garbage-on-commit* nil))
+     , at body))
+
 (defun transaction-commit (transaction &key (rucksack (current-rucksack)))
   "Call transaction-commit-1 to do the real work."
   (transaction-commit-1 transaction (rucksack-cache rucksack) rucksack))
@@ -216,8 +223,9 @@
         (delete-commit-file transaction cache)
         ;; 5. Let the garbage collector do an amount of work proportional
         ;; to the number of octets that were allocated during the commit.
-        (collect-some-garbage heap
-                              (gc-work-for-size heap nr-allocated-octets))
+        (when *collect-garbage-on-commit*
+          (collect-some-garbage heap
+                                (gc-work-for-size heap nr-allocated-octets)))
         ;; 6. Make sure that all changes are actually on disk before
         ;; we continue.
         (finish-all-output rucksack)))))




More information about the rucksack-cvs mailing list