-
Notifications
You must be signed in to change notification settings - Fork 143
fix: unsupported relocation error on arm64 #2555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideReplaces the static std::unique_ptr-based caching of ICU LocaleDisplayNames with a Q_GLOBAL_STATIC-based global holder to avoid unsupported relocations on arm64, and updates includes accordingly. Class diagram for DisplayNamesHolder and globalDisplayNames changesclassDiagram
class DisplayNamesHolder {
+DisplayNamesHolder()
+~DisplayNamesHolder()
icu::LocaleDisplayNames* displayNames
}
class globalDisplayNames {
<<Q_GLOBAL_STATIC>>
+DisplayNamesHolder* operator()()
}
DisplayNamesHolder <.. globalDisplayNames : holds
Class diagram for removal of unique_ptr-based cachingclassDiagram
class getDisplayNames {
- static std::unique_ptr<icu::LocaleDisplayNames> displayNames
+ icu::LocaleDisplayNames* getDisplayNames()
}
getDisplayNames --|> DisplayNamesHolder : now uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @BLumia - I've reviewed your changes - here's some feedback:
- Terminate the Q_GLOBAL_STATIC(DisplayNamesHolder, globalDisplayNames) macro invocation with a semicolon to ensure valid syntax.
- Use a smart pointer (std::unique_ptr) inside DisplayNamesHolder instead of manually deleting the raw pointer for safer resource management.
- Add a null check for the result of createInstance to guard against potential nullptr access.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Terminate the Q_GLOBAL_STATIC(DisplayNamesHolder, globalDisplayNames) macro invocation with a semicolon to ensure valid syntax.
- Use a smart pointer (std::unique_ptr) inside DisplayNamesHolder instead of manually deleting the raw pointer for safer resource management.
- Add a null check for the result of createInstance to guard against potential nullptr access.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Switch to use Q_GLOBAL_STATIC to avoid relocation on CMake obeject library. Log:
|
TAG Bot TAG: 6.1.40 |
deepin pr auto review代码审查意见:
以上是针对代码审查提出的改进意见,希望能够对你有所帮助。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, caixr23 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Switch to use Q_GLOBAL_STATIC to avoid relocation on CMake object library.
Log:
Summary by Sourcery
Bug Fixes: