Permalink
Browse files

t-nil-optimization

Add an optimization for storing the objects T and NIL.

darcs-hash:20090220165500-b71ba-d63f60e5d1b39525c625df1df1c8d0b9b13de413.gz
  • Loading branch information...
1 parent 2cbad7d commit afcc41f3ba922e7ca3b490da7df26bc1d01a44cf sross committed Feb 20, 2009
Showing with 17 additions and 2 deletions.
  1. +16 −0 default-backend.lisp
  2. +1 −2 tests.lisp
View
@@ -60,6 +60,10 @@
(defparameter +unicode-base-string-code+ (register-code 34 'unicode-base-string))
(defparameter +simple-base-string-code+ (register-code 35 'simple-base-string))
+;; T and NIL
+(defparameter +t-code+ (register-code 40 't-object))
+(defparameter +nil-code+ (register-code 41 'nil-object))
+
;; setups for type code mapping
(defun output-type-code (code stream)
(declare (type ub32 code))
@@ -98,6 +102,18 @@
(make-referrer :val (undump-int stream)))
+(defstore-cl-store (obj (eql t) stream)
+ (output-type-code +t-code+ stream))
+
+(defrestore-cl-store (t-object stream)
+ t)
+
+(defstore-cl-store (obj (eql nil) stream)
+ (output-type-code +nil-code+ stream))
+
+(defrestore-cl-store (nil-object stream)
+ nil)
+
;; integers
;; The theory is that most numbers will fit in 32 bits
View
@@ -710,7 +710,6 @@ bar")
(when (probe-file *test-file*)
(ignore-errors (delete-file *test-file*))))
-
-(do-tests)
+(run-tests (find-backend 'cl-store:cl-store))
;; EOF

0 comments on commit afcc41f

Please sign in to comment.