Skip to content

Conversation

@toxaart
Copy link
Contributor

@toxaart toxaart commented May 2, 2025

Added a strdup() method, as requested by the bug reporter. The method is added to Arena, but also available in ResourceArea, as requested. A test for the method is provided.

Testing: tiers 1-4 on multiple platforms.


Progress

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

Issue

  • JDK-8354969: Add strdup function for ResourceArea (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24998

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 2, 2025

👋 Welcome back toxaart! 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.

@openjdk
Copy link

openjdk bot commented May 2, 2025

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

8354969: Add strdup function for ResourceArea

Reviewed-by: dholmes, iklam

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 139 new commits pushed to 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @iklam) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label May 2, 2025
@openjdk
Copy link

openjdk bot commented May 2, 2025

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

  • hotspot

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 openjdk bot added the hotspot hotspot-dev@openjdk.org label May 2, 2025
@mlbridge
Copy link

mlbridge bot commented May 2, 2025

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Do we have any immediate candidate uses for this? Whilst in the past Hotspot code had a number of utility API's, these days there is a tendency to delete any unused code. So this really needs to have an imminent usage (@iklam ?) .

Code change itself looks fine. Thanks

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 9, 2025
@iklam
Copy link
Member

iklam commented May 9, 2025

Do we have any immediate candidate uses for this? Whilst in the past Hotspot code had a number of utility API's, these days there is a tendency to delete any unused code. So this really needs to have an imminent usage (@iklam ?) .

Code change itself looks fine. Thanks

I did this and found a few places, but there could be more

find . -name \*pp | xargs grep -l strcpy | \
    xargs egrep -l '(RESOURCE.*char)|(resource_allocate_bytes)' | \
    xargs grep strcpy

char* prefix_copy = NEW_RESOURCE_ARRAY(char, strlen(prefix)+1);
strcpy(prefix_copy, prefix);

char* orig_copy = NEW_RESOURCE_ARRAY_IN_THREAD(thread, char, strlen(orig)+1);
strcpy(orig_copy, orig);

char* p = resource_allocate_bytes(strlen(prop_value) + 1);
strcpy(p, prop_value);

@dholmes-ora
Copy link
Member

Thanks @iklam ! So should we convert those places as part of this PR?

@iklam
Copy link
Member

iklam commented May 9, 2025

Thanks @iklam ! So should we convert those places as part of this PR?

I think we should do that. @toxaart could you see if there are other cases that can also be converted?

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 14, 2025
@toxaart
Copy link
Contributor Author

toxaart commented May 14, 2025

@iklam I converted the cases you suggested and found a few more. Addressed in the latest commit.

@toxaart toxaart requested a review from dholmes-ora May 14, 2025 07:32
Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM. Please make sure you do sufficient testing before integrating. I would suggest running up to at least tier 4, as changes of this kind sometimes can touch obscure code paths.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 14, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 15, 2025
Copy link
Member

@dholmes-ora dholmes-ora 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! Thanks for the update.

One further, non-essential, suggestion.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 16, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 20, 2025
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Ship it!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 20, 2025
@toxaart
Copy link
Contributor Author

toxaart commented May 20, 2025

Thanks, let's
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 20, 2025
@openjdk
Copy link

openjdk bot commented May 20, 2025

@toxaart
Your change (at version e65548d) is now ready to be sponsored by a Committer.

@dholmes-ora
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented May 20, 2025

Going to push as commit 0db5511.
Since your change was applied there have been 140 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 20, 2025
@openjdk openjdk bot closed this May 20, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 20, 2025
@openjdk
Copy link

openjdk bot commented May 20, 2025

@dholmes-ora @toxaart Pushed as commit 0db5511.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants