Skip to content

Conversation

@s-barannikov
Copy link
Contributor

The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.

Copy link
Contributor Author

s-barannikov commented Aug 29, 2024

@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 7cca421 to 14e8b41 Compare October 27, 2024 00:57
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from e5b70fc to cdb7292 Compare October 27, 2024 00:57
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 14e8b41 to 61be980 Compare October 27, 2024 01:34
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from cdb7292 to d27bc30 Compare October 27, 2024 01:35
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 61be980 to 222a3b7 Compare October 27, 2024 01:39
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from d27bc30 to deca69b Compare October 27, 2024 01:40
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 222a3b7 to 26dc400 Compare February 4, 2025 14:01
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from deca69b to 57104d1 Compare February 4, 2025 14:02
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 26dc400 to e75ad5f Compare April 6, 2025 17:22
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from 57104d1 to fe95d64 Compare April 6, 2025 17:23
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from e75ad5f to 5604e7a Compare April 19, 2025 08:19
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from fe95d64 to 24ff5d6 Compare April 19, 2025 08:19
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 5604e7a to 161e6ba Compare July 11, 2025 16:26
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from 24ff5d6 to 0a21746 Compare July 11, 2025 16:26
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 161e6ba to 68b0d70 Compare July 11, 2025 17:09
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from 0a21746 to b878d88 Compare July 11, 2025 17:09
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 68b0d70 to 4d50f23 Compare July 11, 2025 17:12
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from b878d88 to 1591f0b Compare July 11, 2025 17:12
The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 4d50f23 to 856e1f0 Compare November 8, 2025 09:11
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from 1591f0b to 0d66f01 Compare November 8, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants