mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
2c9a947363
Technically a breaking change, but one that's extremely unlikely to affect any real-world applications. On 64-bit systems, the maximum source text length was exactly `u32::MAX`. Lower it by 256 bytes, for 2 reasons: 1. `oxc_lexer` will require source text to be followed by 64 bytes of padding. Reducing max source length ensures _padded_ length can always fit in a `u32`. 2. Counts of tokens, comments and errors are all bounded by source length plus a small constant. By reducing max source length, these can all be stored as `u32`s without any possibility of overflow. `oxc_lexer` only needs 64 bytes of padding. Have gone with 256 to leave headroom in case later redesigns require more than 64. This avoids another breaking change later. We can always switch to 64 later on if we want, and this later relaxation would not be a breaking change. All the changes to other crates in this PR are just updating comments which talk about max source length.