mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.7k stars 705 forks source link

Increase SSO from 22 to 23 chars. #5186

Closed Icantjuddle closed 3 weeks ago

Icantjuddle commented 3 weeks ago

This change gives an extra character of SSO space.

The core of the change is to make the short-string indicator byte be used for remaining space instead of current size when in short string mode. When there is 0 remaining space, the indicator byte will be 0 which is also a null terminator. Notably this optimization was popularized by Andrei Alexandrescu in fbstring.