Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-28 Thread Justin King
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King wrote: > Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This als

Re: RFR: JDK-8297688: libjli leaks memory related to options handling [v3]

2022-11-28 Thread Justin King
> Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This also removes the second argument to `AddOption` as it is u

Re: RFR: JDK-8297688: libjli leaks memory related to options handling [v2]

2022-11-28 Thread Justin King
> Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This also removes the second argument to `AddOption` as it is u

Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-28 Thread Alan Bateman
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King wrote: > Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This als

Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-27 Thread Justin King
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King wrote: > Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This als

Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-27 Thread David Holmes
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King wrote: > Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This als

Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-27 Thread Justin King
On Mon, 28 Nov 2022 04:02:33 GMT, David Holmes wrote: > Doesn't this just "leak" the duplicated string now instead of the original? No, this frees all the strings in `FreeOptions()`. - PR: https://git.openjdk.org/jdk/pull/11384

Re: RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-27 Thread David Holmes
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King wrote: > Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This als

RFR: JDK-8297688: libjli leaks memory related to options handling

2022-11-27 Thread Justin King
Fix memory leaks by making `AddOption` unconditionally duplicate passed in strings, taking ownership. Callers using dynamic memory free their storage after calling `AddOption`. This ensures no memory is dropped on the floor. This also removes the second argument to `AddOption` as it is unused an