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

JDK-8249753: Add restricted factory to access everything segment #249

Conversation

mcimadamore
Copy link
Collaborator

@mcimadamore mcimadamore commented Jul 20, 2020

This patch adds another restricted factory, namely MemorySegment::ofRestrictedNative(). The new factory takes no arguments and return a segment that has the following characteristics:

  • its base address is MemoryAddress::NULL
  • its size is Long.MAX_VALUE
  • it is non-closeable
  • it is not confined

Note that this is not exactly the everything segment, since, at least in principle, addressable space goes up to 2 ^ 64 - 1 while Long::MAX_VALUE is "only" 2^63 -1. In other words, there is a possibility for some addresses to show up as negative long values, which will then be rejeced during dereference.

That said, for all intent and purposes, the segment returned by the new factory is a close enough approximation to the everything segment; we'd prefer to start with that and expand later (with some concrete use cases) rather than adding a new kind of memory segment which might not be needed.


Progress

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

Issue

  • JDK-8249753: Add restricted factory to access everything segment

Reviewers

  • Jorn Vernee (jvernee - Committer)

Download

$ git fetch https://git.openjdk.java.net/panama-foreign pull/249/head:pull/249
$ git checkout pull/249

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 20, 2020

👋 Welcome back mcimadamore! A progress list of the required criteria for merging this PR into foreign-memaccess will be added to the body of your pull request.

@openjdk openjdk bot added the rfr Ready for review label Jul 20, 2020
@openjdk
Copy link

openjdk bot commented Jul 20, 2020

@mcimadamore This change now passes all automated pre-integration checks, type /integrate in a new comment to proceed. After integration, the commit message will be:

8249753: Add restricted factory to access everything segment

Reviewed-by: jvernee
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

There are currently no new commits on the foreign-memaccess branch since the last update of the source branch of this PR. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you would like to avoid potential automatic rebasing, specify the current head hash when integrating, like this: /integrate 05f747037093fa3b2c8846d81e290a2f5bcdd21a.

➡️ To integrate this PR with the above commit message to the foreign-memaccess branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Jul 20, 2020
@mlbridge
Copy link

mlbridge bot commented Jul 20, 2020

Webrevs

@mcimadamore
Copy link
Collaborator Author

/integrate

@openjdk openjdk bot closed this Jul 20, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Jul 20, 2020
@openjdk
Copy link

openjdk bot commented Jul 20, 2020

@mcimadamore
Pushed as commit 0c76b50.

@mcimadamore mcimadamore deleted the everythingRestricted branch November 13, 2020 14:34
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.

None yet

2 participants