aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-05-27 14:32:09 +0800
committerPo Lu2022-05-27 14:40:43 +0800
commitedd11a2c6e4ea37fe8030ca310b1c009d42ed35e (patch)
treecd061f6377ccc8404334e75d7864ef95ca9f3ef9 /src
parent7da754015f15642b884e11a9b9abeaec838b0c4a (diff)
downloademacs-edd11a2c6e4ea37fe8030ca310b1c009d42ed35e.tar.gz
emacs-edd11a2c6e4ea37fe8030ca310b1c009d42ed35e.zip
Update comments in some X code
* src/xterm.c (x_parse_color): Update comment. (syms_of_xterm): Add new debugging option too.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 4f264ab2a86..00df7dce343 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7264,10 +7264,8 @@ x_hash_string_ignore_case (const char *string)
7264/* On frame F, translate the color name to RGB values. Use cached 7264/* On frame F, translate the color name to RGB values. Use cached
7265 information, if possible. 7265 information, if possible.
7266 7266
7267 Note that there is currently no way to clean old entries out of the 7267 If too many entries are placed in the cache, the least recently
7268 cache. However, it is limited to names in the server's database, 7268 used entries are removed. */
7269 and names we've actually looked up; list-colors-display is probably
7270 the most color-intensive case we're likely to hit. */
7271 7269
7272Status 7270Status
7273x_parse_color (struct frame *f, const char *color_name, 7271x_parse_color (struct frame *f, const char *color_name,
@@ -7351,13 +7349,15 @@ x_parse_color (struct frame *f, const char *color_name,
7351 dpyinfo->color_names[idx] = cache_entry; 7349 dpyinfo->color_names[idx] = cache_entry;
7352 7350
7353 /* Don't let the color cache become too big. */ 7351 /* Don't let the color cache become too big. */
7354 if (dpyinfo->color_names_length[idx] > 128) 7352 if (dpyinfo->color_names_length[idx] > (x_color_cache_bucket_size > 0
7353 ? x_color_cache_bucket_size : 128))
7355 { 7354 {
7356 i = 0; 7355 i = 0;
7357 7356
7358 for (last = dpyinfo->color_names[idx]; last; last = last->next) 7357 for (last = dpyinfo->color_names[idx]; last; last = last->next)
7359 { 7358 {
7360 if (++i == 128) 7359 if (++i == (x_color_cache_bucket_size > 0
7360 ? x_color_cache_bucket_size : 128))
7361 { 7361 {
7362 next = last->next; 7362 next = last->next;
7363 last->next = NULL; 7363 last->next = NULL;
@@ -25941,4 +25941,9 @@ where the drop happened, ACTION is the action that was passed to
25941`x-begin-drag', FRAME is the frame which initiated the drag-and-drop 25941`x-begin-drag', FRAME is the frame which initiated the drag-and-drop
25942operation, and TIME is the X server time when the drop happened. */); 25942operation, and TIME is the X server time when the drop happened. */);
25943 Vx_dnd_unsupported_drop_function = Qnil; 25943 Vx_dnd_unsupported_drop_function = Qnil;
25944
25945 DEFVAR_INT ("x-color-cache-bucket-size", x_color_cache_bucket_size,
25946 doc: /* Most buckets allowed per display in the internal color cache.
25947Values less than 1 mean 128. This option is for debugging only. */);
25948 x_color_cache_bucket_size = 128;
25944} 25949}