Changeset 13823


Ignore:
Timestamp:
Jun 14, 2010, 10:16:02 AM (10 years ago)
Author:
gb
Message:

Indentation/formatting changes only.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/level-0/l0-hash.lisp

    r13789 r13823  
    467467    (if (<= new-size size)
    468468      (setq new-size (1+ size)))        ; God save you if you make this happen
    469    
    470469    (let ((vector-size (%hash-size (max (+ new-size 2) (ceiling (* new-size rehash-ratio))))))
    471470      ; TODO: perhaps allow more entries, based on actual size:
     
    863862               (unless (or (%needs-rehashing-p vector)
    864863                           (%i<= (nhash.grow-threshold hash) 0))
    865                  ;; Note if the puthash fails, grow-threshold will end up too small. This
    866                  ;; just means we might rehash sooner than absolutely necessary, no real
    867                  ;; harm done (the most likely cause of failing is that somebody is
    868                  ;; already rehashing anyway).  DON'T try to incf it back on failure --
    869                  ;; that risks grow-threshold ending up too big (e.g. if somebody rehashes
    870                  ;; before the incf), which _could_ be harmful.
     864                 ;; Note if the puthash fails, grow-threshold will end
     865                 ;; up too small. This just means we might rehash
     866                 ;; sooner than absolutely necessary, no real harm
     867                 ;; done (the most likely cause of failing is that
     868                 ;; somebody is already rehashing anyway).  DON'T try
     869                 ;; to incf it back on failure -- that risks
     870                 ;; grow-threshold ending up too big (e.g. if somebody
     871                 ;; rehashes before the incf), which _could_ be
     872                 ;; harmful.
    871873                 (atomic-decf (nhash.grow-threshold hash))
    872874                 (if (set-hash-key-conditional vector-index vector free-hash-marker key)
     
    877879                     (when (set-hash-value-conditional vector-index vector old-value value)
    878880                       (return-from lock-free-puthash value))))))))
    879     ;; We're here because the table needs rehashing or it was getting rehashed while we
    880     ;; were searching, or no room for new entry, or somebody else claimed the key from
    881     ;; under us (that last case doesn't need to retry, but it's unlikely enough that
    882     ;; it's not worth checking for).  Take care of it and try again.
     881    ;; We're here because the table needs rehashing or it was getting
     882    ;; rehashed while we were searching, or no room for new entry, or
     883    ;; somebody else claimed the key from under us (that last case
     884    ;; doesn't need to retry, but it's unlikely enough that it's not
     885    ;; worth checking for).  Take care of it and try again.
    883886    (lock-free-rehash hash)))
    884887
Note: See TracChangeset for help on using the changeset viewer.