[rucksack-cvs] CVS rucksack
alemmens
alemmens at common-lisp.net
Sat May 20 15:07:28 UTC 2006
Update of /project/rucksack/cvsroot/rucksack
In directory clnet:/tmp/cvs-serv7944/rucksack
Modified Files:
cache.lisp objects.lisp
Log Message:
Let CACHE-TOUCH-OBJECT have an object instead of an object-id as parameter.
(From Nikodemus Siivola.)
--- /project/rucksack/cvsroot/rucksack/cache.lisp 2006/05/16 22:01:27 1.2
+++ /project/rucksack/cvsroot/rucksack/cache.lisp 2006/05/20 15:07:28 1.3
@@ -1,4 +1,4 @@
-;; $Id: cache.lisp,v 1.2 2006/05/16 22:01:27 alemmens Exp $
+;; $Id: cache.lisp,v 1.3 2006/05/20 15:07:28 alemmens Exp $
(in-package :rucksack)
@@ -217,7 +217,8 @@
already dirty, nothing happens."
;; This function is called by (setf slot-value-using-class),
;; slot-makunbound-using-class and p-data-write.
- (let ((transaction (current-transaction)))
+ (let ((object-id (object-id object))
+ (transaction (current-transaction)))
;; Check for transaction conflict.
(let ((old-transaction
(find-conflicting-transaction object-id cache transaction)))
@@ -228,16 +229,13 @@
:old-transaction old-transaction)))
;;
(unless (transaction-changed-object transaction object-id) ; already dirty
- (let ((object (gethash object-id (objects cache))))
- (unless object
- (internal-rucksack-error "Can't find object with id ~D." object-id))
- ;; Remove object from the 'clean objects' hash table.
- ;; It would be nice to remove the object from the 'clean' queue too,
- ;; but that's too expensive. We'll let MAKE-ROOM-IN-CACHE take care
- ;; of that.
- (remhash object-id (objects cache))
- ;; Let the transaction keep track of the dirty object.
- (transaction-touch-object transaction object object-id)))))
+ ;; Remove object from the 'clean objects' hash table.
+ ;; It would be nice to remove the object from the 'clean' queue too,
+ ;; but that's too expensive. We'll let MAKE-ROOM-IN-CACHE take care
+ ;; of that.
+ (remhash object-id (objects cache))
+ ;; Let the transaction keep track of the dirty object.
+ (transaction-touch-object transaction object object-id))))
--- /project/rucksack/cvsroot/rucksack/objects.lisp 2006/05/16 22:01:27 1.2
+++ /project/rucksack/cvsroot/rucksack/objects.lisp 2006/05/20 15:07:28 1.3
@@ -1,4 +1,4 @@
-;; $Id: objects.lisp,v 1.2 2006/05/16 22:01:27 alemmens Exp $
+;; $Id: objects.lisp,v 1.3 2006/05/20 15:07:28 alemmens Exp $
(in-package :rucksack)
@@ -118,7 +118,7 @@
(defmethod persistent-data-write (function (data persistent-data) value
&rest args)
(apply function value (contents data) args)
- (cache-touch-object (object-id data) (cache data)))
+ (cache-touch-object data (cache data)))
(defun make-persistent-data (class contents
&optional (rucksack (current-rucksack)))
@@ -351,7 +351,7 @@
(and old-boundp
(slot-value-using-class class object slot-name-or-def)))
(result (call-next-method)))
- (cache-touch-object (object-id object) (cache object))
+ (cache-touch-object object (cache object))
;; Update indexes.
(rucksack-maybe-index-changed-slot (rucksack object)
class object slot
@@ -377,7 +377,7 @@
(and old-boundp
(slot-value-using-class class object slot-name-or-def)))
(result (call-next-method)))
- (cache-touch-object (object-id object) (cache object))
+ (cache-touch-object object (cache object))
(rucksack-maybe-index-changed-slot (rucksack object)
class object slot
old-value nil
More information about the rucksack-cvs
mailing list