From 6cbf58817f9adb71e0c3557400e31ff7afdc8e31 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 2 Oct 2010 00:01:28 +0200 Subject: [PATCH] Try to keep the async hash table size reasonable. * 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 | 2 ++ lisp/gnus-async.el | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 27cb389d4..b9a36935f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 diff --git a/lisp/gnus-async.el b/lisp/gnus-async.el index 8748252c3..9bb28f3a0 100644 --- a/lisp/gnus-async.el +++ b/lisp/gnus-async.el @@ -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 -- 2.25.1