GeezerVison is showing github.com — Explicitly initialize empty context page by jbachorik · Pull Request #210 · DataDog/java-profiler
Conversation
(followup to #308)
What does this PR do?:
It fixes compilation error on an old g++
Motivation:
We need to build on some rather old systems for compatibility sakes and it requires explicit initialization of the struct
Unsure? Have a question? Request a review!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
yanglong1010 reacted with heart emoji
|
🔧 Report generated by pr-comment-cppcheck
CppCheck ReportErrors (2)
Warnings (4)
Style Violations (296)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🔧 Report generated by pr-comment-scanbuild
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Pull Request Overview
This PR fixes a compilation error on older g++ versions by explicitly initializing an empty context page.
- Updates empty page initialization in the getPage function
- Explicitly sets .capacity and .storage for the empty context case
Comments suppressed due to low confidence (1)
ddprof-lib/src/main/cpp/context.cpp:90
- [nitpick] If your target compiler supports C++11 or later, consider using 'nullptr' instead of 'NULL' for improved type safety. However, if the legacy compatibility is required, this usage is acceptable.
return {.capacity = 0, .storage = NULL};
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
LGTM. For external context- this is necessary for our glibc 2.17 builds.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
r1viollet
Awaiting requested review from r1viollet
+1 more reviewer
MattAlp
MattAlp approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|