Try to keep the async hash table size reasonable.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 1 Oct 2010 22:01:28 +0000 (00:01 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 1 Oct 2010 22:01:28 +0000 (00:01 +0200)
* gnus-async.el (gnus-async-delete-prefetched-entry): Remove from hash
table, too.  Suggested by Stefan Wiens.
(gnus-async-prefetched-article-entry): Use intern-soft to avoid growing
the table unnecessary.  Suggested by Stefan Wiens.

lisp/ChangeLog
lisp/gnus-async.el

index 27cb389..b9a3693 100644 (file)
@@ -2,6 +2,8 @@
 
        * gnus-async.el (gnus-async-delete-prefetched-entry): Remove from hash
        table, too.  Suggested by Stefan Wiens.
+       (gnus-async-prefetched-article-entry): Use intern-soft to avoid growing
+       the table unnecessary.  Suggested by Stefan Wiens.
 
        * gnus-sum.el (gnus-summary-clear-local-variables): This is probably no
        longer needed, and probably doesn't work either, as pointed out by
index 8748252..9bb28f3 100644 (file)
@@ -314,10 +314,10 @@ that was fetched."
     (delete-region (cadr entry) (caddr entry))
     (set-marker (cadr entry) nil)
     (set-marker (caddr entry) nil))
-  (unintern (car entry) gnus-async-hashtb)
   (gnus-async-with-semaphore
     (setq gnus-async-article-alist
-         (delq entry gnus-async-article-alist))))
+         (delq entry gnus-async-article-alist))
+    (unintern (car entry) gnus-async-hashtb)))
 
 (defun gnus-async-prefetch-remove-group (group)
   "Remove all articles belonging to GROUP from the prefetch buffer."
@@ -333,8 +333,8 @@ that was fetched."
   "Return the entry for ARTICLE in GROUP if it has been prefetched."
   (let ((entry (save-excursion
                 (gnus-async-set-buffer)
-                (assq (intern (format "%s-%d" group article)
-                              gnus-async-hashtb)
+                (assq (intern-soft (format "%s-%d" group article)
+                                   gnus-async-hashtb)
                       gnus-async-article-alist))))
     ;; Perhaps something has emptied the buffer?
     (if (and entry