Withdrawn: JDK-8304421: Introduce malloc size feedback
duke
duke at openjdk.org
Tue Jul 11 19:12:26 UTC 2023
On Fri, 17 Mar 2023 17:14:12 GMT, Justin King <jcking at openjdk.org> wrote:
> Memory allocated by `malloc()` is frequently larger than the size actually requested. Some `malloc()` implementations allow querying this information. This can be useful as an optimization for some use cases, such as an arena allocator, as it allows using the entire memory block.
>
> This change updates `os::malloc()` by appending an additional argument that can request the actual usable size. On platforms that support it, the actual usable size of the allocation returned by `malloc()` will be filled in. Callers should then use `os::free_sized`, as with NMT enabled it can assert that the size is correct. This also is a precursor to eventually supporting `free_sized` from C23, which is an optimization usabled by some `malloc()` implementations to make `free()` quicker.
>
> This change also upgrades Chunk to use this facility.
>
> **Observations**
>
> NMT could use this same facility to keep track of the actual allocated size, instead of the requested size it has today, making it more accurate. Doing so is out of scope for this change.
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/13081
More information about the hotspot-runtime-dev
mailing list