(sb!xc:deftype hash-vector () '(simple-array (unsigned-byte 8) (*)))
-(sb!xc:defstruct (package-hashtable (:constructor %make-package-hashtable ())
- (:copier nil))
+(sb!xc:defstruct (package-hashtable
+ (:constructor %make-package-hashtable
+ (table hash size &aux (free size)))
+ (:copier nil))
;; The g-vector of symbols.
- ;; FIXME: could just be type SIMPLE-VECTOR, with (MISSING-ARG) default
- (table nil :type (or simple-vector null))
+ (table (missing-arg) :type simple-vector)
;; The i-vector of pname hash values.
- ;; FIXME: could just be type HASH-VECTOR, with (MISSING-ARG) default
- (hash nil :type (or hash-vector null))
+ (hash (missing-arg) :type hash-vector)
;; The total number of entries allowed before resizing.
;;
;; FIXME: CAPACITY would be a more descriptive name. (This is
;; related to but not quite the same as HASH-TABLE-SIZE, so calling
;; it SIZE seems somewhat misleading.)
- (size 0 :type index)
+ (size (missing-arg) :type index)
;; The remaining number of entries that can be made before we have to rehash.
- (free 0 :type index)
+ (free (missing-arg) :type index)
;; The number of deleted entries.
(deleted 0 :type index))
\f
#!+sb-doc
"the standard structure for the description of a package"
;; the name of the package, or NIL for a deleted package
- (%name nil :type (or simple-string null))
+ (%name nil :type (or simple-base-string null))
;; nickname strings
(%nicknames () :type list)
;; packages used by this package
;; shadowing symbols
(%shadowing-symbols () :type list)
;; documentation string for this package
- (doc-string nil :type (or simple-string null)))
+ (doc-string nil :type (or simple-base-string null)))
\f
;;;; iteration macros
(flet ((iterate-over-hash-table (table ignore)
(let ((hash-vec (package-hashtable-hash table))
(sym-vec (package-hashtable-table table)))
- (declare (type (simple-array (unsigned-byte 8) (*))
- hash-vec)
- (type simple-vector sym-vec))
(dotimes (i (length sym-vec))
(when (>= (aref hash-vec i) 2)
(let ((sym (aref sym-vec i)))
(table (package-external-symbols package))
(hash-vec (package-hashtable-hash table))
(sym-vec (package-hashtable-table table)))
- (declare (type (simple-array (unsigned-byte 8) (*))
- hash-vec)
- (type simple-vector sym-vec))
(dotimes (i (length sym-vec))
(when (>= (aref hash-vec i) 2)
(,flet-name (aref sym-vec i))))))
(flet ((iterate-over-hash-table (table)
(let ((hash-vec (package-hashtable-hash table))
(sym-vec (package-hashtable-table table)))
- (declare (type (simple-array (unsigned-byte 8) (*))
- hash-vec)
- (type simple-vector sym-vec))
(dotimes (i (length sym-vec))
(when (>= (aref hash-vec i) 2)
(,flet-name (aref sym-vec i)))))))
`((:internal
(setf ,',counter
(position-if #',',real-symbol-p
- ,',hash-vector
+ (the hash-vector ,',hash-vector)
:start (if ,',counter
(1+ ,',counter)
0)))
`((:external
(setf ,',counter
(position-if #',',real-symbol-p
- ,',hash-vector
+ (the hash-vector ,',hash-vector)
:start (if ,',counter
(1+ ,',counter)
0)))
(flet ((,',inherited-symbol-p (number)
(when (,',real-symbol-p number)
(let* ((p (position
- number ,',hash-vector
+ number
+ (the hash-vector
+ ,',hash-vector)
:start (if ,',counter
(1+ ,',counter)
0)))
(car ,',packages)))
:inherited)))))
(setf ,',counter
- (position-if #',',inherited-symbol-p
- ,',hash-vector
- :start (if ,',counter
- (1+ ,',counter)
- 0))))
+ (when ,',hash-vector
+ (position-if #',',inherited-symbol-p
+ (the hash-vector
+ ,',hash-vector)
+ :start (if ,',counter
+ (1+ ,',counter)
+ 0)))))
(cond (,',counter
(return-from
,',BLOCK