Repository navigation
Update OpenCC's vendored RapidJSON to align with 1.1.0.bcr.20250205 - #1368
Merged
Merged
Conversation
Sync deps/rapidjson-1.1.0/rapidjson/ with the BCR module version that MODULE.bazel already depends on, so the vendored copy used by CMake and wasm-lib build.sh stays consistent with the Bazel build. The BCR version already includes all previously local patches (Win ARM64, GenericStringRef assignment, iterator deprecation). Adds three new files: cursorstreamwrapper.h, internal/clzll.h, uri.h.
rapidjson 1.1.0.bcr.20250205 already includes all three fixes we carried in deps/rapidjson-1.1.0: the Win ARM64 endianness fix, the GenericStringRef assignment removal, and the std::iterator deprecation fix for C++17. No local patch is needed. - MODULE.bazel: add bazel_dep for rapidjson 1.1.0.bcr.20250205 - src/BUILD.bazel: //deps/rapidjson-1.1.0:rapidjson → @rapidjson//:rapidjson
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.
CrtAllocator 改動(小)
MemoryPoolAllocator 結構改動(大,但相容)
核心變化是引入 SharedData(含 refcount),讓 allocator 可以被 copy:
純新增(無破壞性)
對 OpenCC 的影響評估
OpenCC 只用 rapidjson 做 JSON config parsing(rapidjson::Document),走預設
MemoryPoolAllocator,不直接複製 allocator 也不用 user buffer
構造函式。唯一可感知的行為差異是:現在每次 MemoryPoolAllocator
構造時就會立即分配一小塊記憶體(SharedData + 第一個 ChunkHeader header,共約 64
bytes),而舊版是惰性的。解析 config 期間記憶體本來就夠用,這個差異對 OpenCC 沒有影響。
結論:安全。 這些改動是 rapidjson upstream master 多年累積的 bugfix + 功能增強,BCR
只是把它們打包進來。對 OpenCC 現有的使用方式完全向後相容。