[movitz-cvs] CVS update: movitz/storage-types.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Mon Jul 12 11:09:12 UTC 2004


Update of /project/movitz/cvsroot/movitz
In directory common-lisp.net:/tmp/cvs-serv22544

Modified Files:
	storage-types.lisp 
Log Message:
Changed the low-level formatting of bignums: Now the number of bigits
is stored as factors of 4. This restricts the number of bigits to
(1- (expt 2 14)), which is still plenty.

Date: Mon Jul 12 04:09:12 2004
Author: ffjeld

Index: movitz/storage-types.lisp
diff -u movitz/storage-types.lisp:1.26 movitz/storage-types.lisp:1.27
--- movitz/storage-types.lisp:1.26	Thu Jul  8 05:01:51 2004
+++ movitz/storage-types.lisp	Mon Jul 12 04:09:12 2004
@@ -9,7 +9,7 @@
 ;;;; Created at:    Sun Oct 22 00:22:43 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: storage-types.lisp,v 1.26 2004/07/08 12:01:51 ffjeld Exp $
+;;;; $Id: storage-types.lisp,v 1.27 2004/07/12 11:09:12 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -1243,7 +1243,15 @@
    (length
     :binary-type lu16
     :initarg :length
-    :accessor movitz-bignum-length)
+    :accessor movitz-bignum-length
+    :map-binary-write (lambda (x &optional type)
+			(declare (ignore type))
+			(check-type x (unsigned-byte 14))
+			(* x 4))
+    :map-binary-read (lambda (x &optional type)
+		       (declare (ignore type))
+		       (assert (zerop (mod x 4)))
+		       (truncate x 4)))
    (bigit0 :binary-type :label)
    (value
     :initarg :value





More information about the Movitz-cvs mailing list