| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Create named struct `UnicodeVersion` to use instead of tuple type for
`UNICODE_VERSION` value. This allows user to access the fields with
meaningful field names: `major`, `minor`, and `micro`.
Per request, an empty private field is added to the struct, so it can be
extended in the future without API breakage.
|
|
Use `u32` for version components, as `u64` is just an overkill, and
`u32` is the default type for integers and the default type used for
regular internal numbers.
There's no expectation for Unicode Versions to even reach one thousand
in the next hundered years. This is different from *package versions*,
which may become something auto-generated and exceed human-friendly
range of integer values.
|
|
|
|
The only place this Python script is used is inside the libstd_unicode
crate, so lets move it there.
|
|
`BoolTrie` works well for sets of code points spread out through
most of Unicode’s range, but is uses a lot of space for sets
with few, mostly low, code points.
This switches a few of its instances to a similar but simpler trie
data structure.
## Before
`size_of::<BoolTrie>()` is 1552, which is added to
`table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`:
* `Cc_table`: 1632
* `White_Space_table`: 1656
* `Pattern_White_Space_table`: 1640
* Total: 4928 bytes
## After
`size_of::<SmallBoolTrie>()` is 32, which is added to
`t.r1.len() + t.r2.len() * 8`:
* `Cc_table`: 51
* `White_Space_table`: 273
* `Pattern_White_Space_table`: 193
* Total: 517 bytes
## Difference
Every Rust program with `std` statically linked should be about 4 KB smaller.
|
|
Fixes #26554.
|