Skip to content
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

8281412: MemorySegment::map should live in FileChannel #668

Conversation

FrauBoes
Copy link
Member

@FrauBoes FrauBoes commented Mar 10, 2022

This change moves the factory for mapped memory segments to FileChannel, as a new instance method map, which moves it closer to the existing FileChannel::map that returns a MappedByteBuffer.

Tests are adjusted accordingly and a new test for custom file channels (that do/don't override the method) is added.


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed

Issue

  • JDK-8281412: MemorySegment::map should live in FileChannel

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/panama-foreign pull/668/head:pull/668
$ git checkout pull/668

Update a local copy of the PR:
$ git checkout pull/668
$ git pull https://git.openjdk.java.net/panama-foreign pull/668/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 668

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/panama-foreign/pull/668.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 10, 2022

👋 Welcome back jboes! A progress list of the required criteria for merging this PR into foreign-preview will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 10, 2022

@FrauBoes this pull request can not be integrated into foreign-preview due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout filechannel-mapAsMemorySegment
git fetch https://git.openjdk.java.net/panama-foreign foreign-preview
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge foreign-preview"
git push

@openjdk openjdk bot added merge-conflict rfr Ready for review labels Mar 10, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 10, 2022

Webrevs

@openjdk openjdk bot removed the merge-conflict label Mar 10, 2022
Copy link
Collaborator

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some javadoc tweaks are probably required.

Copy link
Collaborator

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@openjdk
Copy link

openjdk bot commented Mar 11, 2022

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

8281412: MemorySegment::map should live in FileChannel

Reviewed-by: mcimadamore

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 80 new commits pushed to the foreign-preview branch:

  • cad5d16: Automatic merge of master into foreign-preview
  • 53c5268: Automatic merge of jdk:master into master
  • 95ca944: 8282354: Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/ tests
  • f99193a: 8282811: Typo in IAE details message of RecordedObject.getValueDescriptor
  • cab9def: 8282700: Properly handle several --without options during configure
  • 1a5a496: 8282763: G1: G1CardSetContainer remove intrusive-list details.
  • 88f0938: 8272493: Suboptimal code generation around Preconditions.checkIndex intrinsic with AVX2
  • a5a1a32: 8282883: Use JVM_LEAF to avoid ThreadStateTransition for some simple JVM entries
  • bb7ee5a: 8282314: nsk/jvmti/SuspendThread/suspendthrd003 may leak memory
  • f5217b4: 8282852: Debug agent asserts in classTrack_addPreparedClass()
  • ... and 70 more: https://git.openjdk.java.net/panama-foreign/compare/b1020d11b933935410e5e62f4023ab27853b85c7...foreign-preview

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 foreign-preview branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Mar 11, 2022
@FrauBoes
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 11, 2022

Going to push as commit c28366d.
Since your change was applied there have been 80 commits pushed to the foreign-preview branch:

  • cad5d16: Automatic merge of master into foreign-preview
  • 53c5268: Automatic merge of jdk:master into master
  • 95ca944: 8282354: Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/ tests
  • f99193a: 8282811: Typo in IAE details message of RecordedObject.getValueDescriptor
  • cab9def: 8282700: Properly handle several --without options during configure
  • 1a5a496: 8282763: G1: G1CardSetContainer remove intrusive-list details.
  • 88f0938: 8272493: Suboptimal code generation around Preconditions.checkIndex intrinsic with AVX2
  • a5a1a32: 8282883: Use JVM_LEAF to avoid ThreadStateTransition for some simple JVM entries
  • bb7ee5a: 8282314: nsk/jvmti/SuspendThread/suspendthrd003 may leak memory
  • f5217b4: 8282852: Debug agent asserts in classTrack_addPreparedClass()
  • ... and 70 more: https://git.openjdk.java.net/panama-foreign/compare/b1020d11b933935410e5e62f4023ab27853b85c7...foreign-preview

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 11, 2022
@openjdk openjdk bot closed this Mar 11, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Mar 11, 2022
@openjdk
Copy link

openjdk bot commented Mar 11, 2022

@FrauBoes Pushed as commit c28366d.

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

@FrauBoes FrauBoes deleted the filechannel-mapAsMemorySegment branch March 11, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants