-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8301070: Replace NULL with nullptr in share/memory/ #12185
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
👋 Welcome back jsjolen! A progress list of the required criteria for merging this PR into |
@jdksjolen The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
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.
Found one manual fix
src/hotspot/share/memory/heap.cpp
Outdated
insert_after(prev, b); | ||
_last_insert_point = prev; | ||
} | ||
|
||
/** | ||
* Search freelist for an entry on the list with the best fit. | ||
* @return NULL, if no one was found | ||
* @return nullptr, if no one was found |
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.
null
Webrevs
|
Passes tier1. |
@@ -226,7 +226,7 @@ class GuardedMemory : StackObj { // Wrapper on stack | |||
/** | |||
* Return the general purpose tag. | |||
* | |||
* @return the general purpose tag, defaults to NULL. | |||
* @return the general purpose tag, defaults to nullptr. |
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.
nullptr => null?
void* wrap_with_guards(void* base_ptr, size_t user_size, const void* tag = NULL) { | ||
assert(base_ptr != NULL, "Attempt to wrap NULL with memory guard"); | ||
void* wrap_with_guards(void* base_ptr, size_t user_size, const void* tag = nullptr) { | ||
assert(base_ptr != nullptr, "Attempt to wrap nullptr with memory guard"); |
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.
wrap nullptr => wrap null?
@@ -303,9 +303,9 @@ class GuardedMemory : StackObj { // Wrapper on stack | |||
* @param len the length of the copy | |||
* @param tag optional general purpose tag (see GuardedMemory::get_tag()) | |||
* | |||
* @return guarded wrapped memory pointer to the user area, or NULL if OOM. | |||
* @return guarded wrapped memory pointer to the user area, or nullptr if OOM. |
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.
nullptr => null?
@jdksjolen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 116 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
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.
Metaspace changes are good.
for (;;) { | ||
DEBUG_ONLY(check_node(insertion_point);) | ||
if (n->_word_size == insertion_point->_word_size) { | ||
add_to_list(n, insertion_point); // parent stays NULL in this case. | ||
add_to_list(n, insertion_point); // parent stays null in this case. |
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.
Small nit. Do we have a unified naming scheme for comments?
"null" reads like a java null. I prefer keeping NULL in comments.
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.
Small nit. Do we have a unified naming scheme for comments?
Yeah, I forgot to update the PR message with all of the info. If you check now you can see what's been decided upon. The discussions can be found in previous PRs, I can link to them if you're curious.
"null" reads like a java null. I prefer keeping NULL in comments.
That's true, but this probably can be inferred from context which one is meant quite easily? I'd be more keen on explicitly saying that something is a Java null.
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.
FWIW, from fixing these reviews I've never seen us referring to a Java null when we meant a C++ nullptr.
/integrate Passes tests and two approvals (with stefank's suggested fixes included), integrating. |
Going to push as commit d98a323.
Your commit was automatically rebased without conflicts. |
@jdksjolen Pushed as commit d98a323. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory share/memory/. Unfortunately the script that does the change isn't perfect, and so we
need to comb through these manually to make sure nothing has gone wrong. I also review these changes but things slip past my eyes sometimes.
Here are some typical things to look out for:
An example of this:
Note how
nullptr
participates in a code expression here, we really are talking about the specific valuenullptr
.Thanks!
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12185/head:pull/12185
$ git checkout pull/12185
Update a local copy of the PR:
$ git checkout pull/12185
$ git pull https://git.openjdk.org/jdk pull/12185/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12185
View PR using the GUI difftool:
$ git pr show -t 12185
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12185.diff