diff options
| author | Stefan Kangas | 2021-10-30 20:11:16 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2021-10-30 20:24:25 +0200 |
| commit | da67e888d5360297cdf20cd3d2a1148727d16e5a (patch) | |
| tree | 5cae7280d08908f4f6f92b8670ebfe08bfacb4c9 /src | |
| parent | ba9ae325e52a46299d914bd021f2200736c6bc85 (diff) | |
| download | emacs-da67e888d5360297cdf20cd3d2a1148727d16e5a.tar.gz emacs-da67e888d5360297cdf20cd3d2a1148727d16e5a.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/image.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 08dac5d4557..e03e21fddcf 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3162,7 +3162,7 @@ struct image_cache | |||
| 3162 | 3162 | ||
| 3163 | /* Size of bucket vector of image caches. Should be prime. */ | 3163 | /* Size of bucket vector of image caches. Should be prime. */ |
| 3164 | 3164 | ||
| 3165 | #define IMAGE_CACHE_BUCKETS_SIZE 1001 | 3165 | #define IMAGE_CACHE_BUCKETS_SIZE 1009 |
| 3166 | 3166 | ||
| 3167 | #endif /* HAVE_WINDOW_SYSTEM */ | 3167 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 3168 | 3168 | ||
diff --git a/src/image.c b/src/image.c index 1c31bdd3d95..2ec44584b66 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -4116,9 +4116,9 @@ struct xpm_cached_color | |||
| 4116 | }; | 4116 | }; |
| 4117 | 4117 | ||
| 4118 | /* The hash table used for the color cache, and its bucket vector | 4118 | /* The hash table used for the color cache, and its bucket vector |
| 4119 | size. */ | 4119 | size (which should be prime). */ |
| 4120 | 4120 | ||
| 4121 | #define XPM_COLOR_CACHE_BUCKETS 1001 | 4121 | #define XPM_COLOR_CACHE_BUCKETS 1009 |
| 4122 | static struct xpm_cached_color **xpm_color_cache; | 4122 | static struct xpm_cached_color **xpm_color_cache; |
| 4123 | 4123 | ||
| 4124 | /* Initialize the color cache. */ | 4124 | /* Initialize the color cache. */ |