You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compact_string crate manages to store a string with length 24 inline by using that all strings in Rust are UTF8 encoded.
This isn't really an important thing to do, because most applications will either have strings with a length much greater than 16 or much less than 15. Just wanted to point out that it's possible.
The text was updated successfully, but these errors were encountered:
I don't think it works for ecow because we already use a full bit of the last byte to distinguish heap vs inline. CompactStr, having 24 bytes rather than 16 bytes, always has a single byte value rather than half of a byte's range for the heap case.
The
compact_string
crate manages to store a string with length 24 inline by using that all strings in Rust are UTF8 encoded.This isn't really an important thing to do, because most applications will either have strings with a length much greater than 16 or much less than 15. Just wanted to point out that it's possible.
The text was updated successfully, but these errors were encountered: