jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8286431: Do not use resource array in posix mmap_attach_shared()

Open iklam opened this issue 3 years ago • 4 comments

Please review this small clean up

perfMemory_posix.cpp uses a lot of explicit C heap alloc/free because the function may be called during early VM bootstrap, before ResourceMark can be used.

However, we have a single odd use of resource allocation in this file. It's supposed to work with Java exceptions. However, the code actually makes an explicitly exception check, so there's no need to do the resource alloc at all.

Also, there's no need to close the fd in case of exception.


Progress

  • [x] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8286431: Do not use resource array in posix mmap_attach_shared()

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10686/head:pull/10686
$ git checkout pull/10686

Update a local copy of the PR:
$ git checkout pull/10686
$ git pull https://git.openjdk.org/jdk pull/10686/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10686

View PR using the GUI difftool:
$ git pr show -t 10686

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10686.diff

iklam avatar Oct 13 '22 03:10 iklam

:wave: Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Oct 13 '22 03:10 bridgekeeper[bot]

@iklam The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

openjdk[bot] avatar Oct 13 '22 03:10 openjdk[bot]

Webrevs

mlbridge[bot] avatar Oct 13 '22 03:10 mlbridge[bot]

@iklam 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:

8286431: Do not use resource array in posix mmap_attach_shared()

Reviewed-by: dholmes, jsjolen

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 3 new commits pushed to the master branch:

  • 4d9a1cd26fa0cda902aafcccd6e02bd7bc60bbb3: 8292159: TYPE_USE annotations on generic type arguments of record components discarded
  • 210fe49e25da0ed6f3d3799ed253d9374568b89e: 6244831: JFileChooser does not have tooltip for Desktop, Recent etc ToggleButton on Windows Look and feel
  • c2d7a35a4b3ec7d9c567cdd98c2db958c4b2e9d2: 8269235: serviceability/sa/ClhsdbJstackXcompStress.java timed out

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch. 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 master branch, type /integrate in a new comment.

openjdk[bot] avatar Oct 13 '22 23:10 openjdk[bot]

Thanks @dholmes-ora and @jdksjolen for the review. /integrate

iklam avatar Oct 27 '22 05:10 iklam

Going to push as commit 521e71222a8a01edcffedafb2d57c16aa070545c. Since your change was applied there have been 3 commits pushed to the master branch:

  • 4d9a1cd26fa0cda902aafcccd6e02bd7bc60bbb3: 8292159: TYPE_USE annotations on generic type arguments of record components discarded
  • 210fe49e25da0ed6f3d3799ed253d9374568b89e: 6244831: JFileChooser does not have tooltip for Desktop, Recent etc ToggleButton on Windows Look and feel
  • c2d7a35a4b3ec7d9c567cdd98c2db958c4b2e9d2: 8269235: serviceability/sa/ClhsdbJstackXcompStress.java timed out

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Oct 27 '22 05:10 openjdk[bot]

@iklam Pushed as commit 521e71222a8a01edcffedafb2d57c16aa070545c.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar Oct 27 '22 05:10 openjdk[bot]