Integrated: 8296453: Simplify resource_area uses in ClassPathDirEntry::open_stream
Xin Liu
xliu at openjdk.org
Wed Nov 16 22:44:32 UTC 2022
On Mon, 7 Nov 2022 17:17:35 GMT, Xin Liu <xliu at openjdk.org> wrote:
> Currently it is correct, but there are two places we can improve it.
>
> 1. We should assert that current == Thread::current(). If it were not case, then we would intermix NEW_RESOURCE_ARRAY_IN_THREAD(current, char, path_len) and FREE_RESOURCE_ARRAY(char, path, path_len)!
>
> 2. We don't need to call FREE_RESOURCE_ARRAY(char, path, path_len) for path in its first exit. It won't release anything because buffer stands in its way.
>
> The resource area is like this. `Afree(path, path_len)` won't reclaim the space.
>
> |path | buffer |...|
> ^hwm
This pull request has now been integrated.
Changeset: 2159170b
Author: Xin Liu <xliu at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2159170b414c6b8b8beec3c202239c73f298abf7
Stats: 17 lines in 4 files changed: 7 ins; 0 del; 10 mod
8296453: Simplify resource_area uses in ClassPathDirEntry::open_stream
Reviewed-by: dholmes, phh
-------------
PR: https://git.openjdk.org/jdk/pull/11024
More information about the hotspot-runtime-dev
mailing list