JDK-8264285 : Clean the modification of ccstr JVM flags
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-03-26
  • Updated: 2021-04-08
  • Resolved: 2021-04-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b17Fixed
Related Reports
Relates :  
Description
There are two versions of JVMFlagAccess::ccstrAtPut() for modifying JVM flags of the ccstr type (i.e., strings).

See https://github.com/openjdk/jdk/blob/4e74de4b2eec611b49ee8defae1ab06351280008/src/hotspot/share/runtime/flags/jvmFlagAccess.cpp

- One version requires the caller to free the old value, but some callers don't do that (writeableFlags.cpp).

- The other version frees the old value on behalf of the caller. However, this version is accessible only via FLAG_SET_XXX macros and is currently unused. So it's unclear whether it actually works.

We should combine these two versions into a single function, fix problems in the callers, and add test cases. The old value should be freed automatically, because typically the caller isn't interested in the old value.

Note that the FLAG_SET_XXX macros do not return the old value. Requiring the caller of FLAG_SET_XXX to free the old value would be tedious and error prone.

Comments
Changeset: 58583990 Author: Ioi Lam <iklam@openjdk.org> Date: 2021-04-01 18:25:14 +0000 URL: https://git.openjdk.java.net/jdk/commit/58583990
01-04-2021