emacs-devel
[Top][All Lists]
Advanced

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

[PATCH] Fix a hash lookup problem in xfaces.c


From: Zhehao Lin
Subject: [PATCH] Fix a hash lookup problem in xfaces.c
Date: Sat, 1 Jan 2022 17:52:41 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

Hello, this patch fixes a problem in the `face_for_font` function in `src/
xfaces.c` where an `unsigned` instead of an `uintptr_t` was used to store the
computed hash value of the face. If the hash value was too large (>UINT_MAX)
and truncated, the lookup and storing (the latter uses `uintptr_t` as the rest of the program does) would happen in different buckets, resulting in constant
cache misses.

This can cause huge performance impact when `face_for_font' is called really
frequently (for example with ligatures enabled), but for brevity please allow
me to omit the details here.

Zhehao Lin

Attachment: 0001-src-xfaces.c-Use-uintptr_t-instead-of-unsigned-to-st.patch
Description: Text Data


reply via email to

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