RFR: JDK-8304684: Memory leak in DirectivesParser::set_option_flag [v2]
Justin King
jcking at openjdk.org
Fri Mar 24 19:30:29 UTC 2023
On Fri, 24 Mar 2023 00:03:21 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Worse yet, it looks like the default value can point to the existing storage of the DisableIntrinsic and ControlIntrinsic global values, making it doubly hard to know if the storage can be freed, unless we get rid of simple = assignment and always allocate new memory when assigning the string values.
>> But why re-invent the wheel? Can't we use something like C++ std::string to manage the lifetimes for us?
>
> Or maybe ~DirectiveSet could use the _modified array to decide if it should free the string flags.
`DirectiveSet::compilecommand_compatibility_init` makes things even more complicated, because it doesnt update `_modified` and it should probably be making a copy of the string provided via `CompilerOracle::has_option_value`. Ugh...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13125#discussion_r1147979655
More information about the hotspot-compiler-dev
mailing list