diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-06-13 10:14:15 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-06-15 17:25:00 +0000 |
| commit | edd68732ad472a7a9ae824fe3be06f8f111754d6 (patch) | |
| tree | 69bf5d686d2ddc385904efb9ad9682a7425d22a7 /debug.c | |
| parent | selection: allow HT, VT and FF, disallow NUL in non-bracketed paste mode (diff) | |
vt: prevent potential endless loop when finding a slot for a composed character
Composed characters are stored in a tree structure, using a key as
identifier. The key is calculated from the individual characters that
make up the composed character sequence.
Since the address space for keys is limited, collisions may occur. In
this case, we simply increment the key and try again.
It is theoretically possible to saturate the key space, in which case
we’ll get stuck in an endless loop.
Even if the key space isn’t fully saturated, we fairly easy reach a
point where there are so many collisions for each insertion, that
performance drops significantly.
Since key space is limited (it’s not like a hash table that we can
grow), our only option is to limit the number of collisions. If we
can’t find a slot within a hard code amount of collisions, the
character is simply dropped.
Diffstat (limited to 'debug.c')
0 files changed, 0 insertions, 0 deletions
