Merged
Conversation
DHowett
reviewed
Jun 10, 2025
|
|
||
| // I wonder if it would make sense to use a Cow here. But probably not. | ||
| std::ptr::copy_nonoverlapping(src_cache, dst_cache, 1); | ||
| ut.a = -1; |
Member
There was a problem hiding this comment.
so this works by forcing the regeneration of all properties given the new text buffer generation?
Member
Author
There was a problem hiding this comment.
Technically this is optional. The only use of .a is to detect whether the Cache is stale / dirty. But since we initialize it with memset(0) it's not just stale, it's also empty. So no matter what, utext_access will detect it as stale.
DHowett
reviewed
Jun 10, 2025
| ut.a = tb.generation() as i64; | ||
|
|
||
| // ICU unfortunately expects a `UText` instance to have valid contents after construction. | ||
| utext_access(ut, 0, true); |
Member
Author
There was a problem hiding this comment.
Honestly, I'm not sure. I'm somewhat surprised this works, but I'd like to go with that. I checked the internal ICU implementation, and it looked similar.
DHowett
approved these changes
Jun 10, 2025
Lou32Verbose
pushed a commit
to Lou32Verbose/edit
that referenced
this pull request
Jan 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #450