[crac] RFR: RFC: -XX:CPUFeatures=0xnumber for CPU migration [v2]
Jan Kratochvil
duke at openjdk.org
Thu Feb 2 14:47:08 UTC 2023
On Thu, 2 Feb 2023 14:34:48 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:
>> The number must fit in `pid_t` (otherwise it is a weird Linux kernel). Therefore `int`. But there is no `strtoi`. Also PID must not be negative (otherwise it is a weird Linux kernel again). So I found this as the most simple and safe code to validate `name` contains a non-negative number which can fit in `pid_t`.
>
>> The number must fit in `pid_t` (otherwise it is a weird Linux kernel). Therefore `int`. But there is no `strtoi`.
>
> If we're boxing to an int, then I think we should check if `l >= INT_MAX` rather than `LONG_MAX`.
The `int` check is there `ent_tid != (long) l` (as nobody says `pid_t` is really an `int`). The `l >= LONG_MAX` is there to make valid the cast `(long) l`. But this is IMO a [bikeshed](https://en.wikipedia.org/wiki/Law_of_triviality).
-------------
PR: https://git.openjdk.org/crac/pull/41
More information about the crac-dev
mailing list