emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master da67e88: Use primes for hash table bucket sizes


From: Stefan Kangas
Subject: master da67e88: Use primes for hash table bucket sizes
Date: Sat, 30 Oct 2021 14:24:33 -0400 (EDT)

branch: master
commit da67e888d5360297cdf20cd3d2a1148727d16e5a
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Use primes for hash table bucket sizes
    
    * src/dispextern.h (IMAGE_CACHE_BUCKETS_SIZE):
    * src/image.c (XPM_COLOR_CACHE_BUCKETS): Use primes for hash table
    bucket sizes.
---
 src/dispextern.h | 2 +-
 src/image.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 08dac5d..e03e21f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3162,7 +3162,7 @@ struct image_cache
 
 /* Size of bucket vector of image caches.  Should be prime.  */
 
-#define IMAGE_CACHE_BUCKETS_SIZE 1001
+#define IMAGE_CACHE_BUCKETS_SIZE 1009
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
diff --git a/src/image.c b/src/image.c
index 1c31bdd..2ec4458 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4116,9 +4116,9 @@ struct xpm_cached_color
 };
 
 /* The hash table used for the color cache, and its bucket vector
-   size.  */
+   size (which should be prime).  */
 
-#define XPM_COLOR_CACHE_BUCKETS        1001
+#define XPM_COLOR_CACHE_BUCKETS 1009
 static struct xpm_cached_color **xpm_color_cache;
 
 /* Initialize the color cache.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]