RFR: 8300645: Revert julong changes from 8194232 after 8292083
Severin Gehwolf
sgehwolf at openjdk.org
Mon Feb 13 17:50:30 UTC 2023
On Mon, 13 Feb 2023 17:33:22 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> The thing with `GET_CONTAINER_INFO` is that it's a preprocessor macro which might trigger a short return. So this cannot happen (currently). The assert is a safeguard. I'm not sure we need this handled in product code. Thoughts?
>
> Surely it can happen because `subsystem_file_line_contents` may successfully parse `-1` into a `jlong`? Assuming that the file can contain a negative number. I don't think I understand why we have the safeguard there otherwise.
The files won't contain negative numbers, AFAIK. Only some random large numbers or the actual limit. `-2` is being returned by the macro if the file doesn't exist or some other error occurs (basically this case). Since this repeatedly causes confusion for me when I revisit this code, I've added the assert for clarity. When we reach line 94, we can be sure that we get a positive value. If you want the assert removed, that's fine with me as well. To me, having the assert there is clearer, though.
-------------
PR: https://git.openjdk.org/jdk/pull/12166
More information about the hotspot-runtime-dev
mailing list