Changeset 6015


Ignore:
Timestamp:
Mar 9, 2007, 6:47:30 AM (13 years ago)
Author:
gb
Message:

When REMHASH deletes the last entry in a hash-table, it fills
the hash-table vector with "free" markers. (There may already
be lots of "deleted" markers in the table.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-hash.lisp

    r4151 r6015  
    741741             ;; Delete the value from the table.
    742742             (setf (%svref vector vector-index) deleted-hash-key-marker
    743                    (%svref vector (the fixnum (1+ vector-index))) nil)))))
     743                   (%svref vector (the fixnum (1+ vector-index))) nil))))
     744       (when (and foundp
     745                (zerop (the fixnum (nhash.count hash))))
     746         (do* ((i $nhash.vector_overhead (1+ i))
     747               (n (uvsize vector)))
     748              ((= i n))
     749           (declare (fixnum i n))
     750           (setf (%svref vector i) free-hash-key-marker))
     751         (setf (nhash.grow-threshold hash)
     752               (+ (nhash.vector.deleted-count vector)
     753                  (nhash.vector.weak-deletions-count vector)
     754                  (nhash.grow-threshold hash))
     755               (nhash.vector.deleted-count vector) 0
     756               (nhash.vector.weak-deletions-count vector) 0)))
    744757     ;; Return T if we deleted something
    745758     (%unlock-gc-lock)
Note: See TracChangeset for help on using the changeset viewer.