RFR: 8151413: os::allocation_granularity/page_size and friends return signed values [v3]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Thu Jan 19 22:54:27 UTC 2023
On Thu, 19 Jan 2023 19:00:30 GMT, Afshin Zafari <duke at openjdk.org> wrote:
>> ### Description
>> os::allocation_granularity/page_size and friends return signed values
>>
>> ### Patch
>> - Type of `vm_page_size` and `vm_allocation_granularity` members of `OSInfo` class and their wrappers in `os` class changed to `size_t`
>> - Initial value of them changed from -1 to 0.
>> - In setters, checking for *set only once* condition is updated accordingly (comparing with 0 instead of -1). Also, checking the argument be positive is removed.
>> - Equal to 0 (instead of `<= 0` ) is used to check if calling setters failed.
>> - All `(size_t)` casting of getters removed.
>> - In arithmetic and negation operations, the operand related to the getters casted to `(int)`. Otherwise, the Windows builds complain.
>> - Explicitly casted to `(int)` where `jint` needed.
>> - In `<T, A> align_up(T size, A alignment)`, assignment of variables of type `A` to type `T` (i.e., `T t = (A) a;`) should be safe. `T : size_t` and `A : int` won't compile. Fixed appropriately.
>> - `"%d"` format-flags replaced with `SIZE_FORMAT`.
>> - Type of `CompilerToVM::Data::vm_page_size` changed to `size_t`.
>>
>> ### Test
>> tier1-5: all green, except an unrelated fail for whom a bug is already created.
>> job-id: afshin-8151413-20230117-1255-40910454
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>
> 8151413: os::allocation_granularity/page_size and friends return signed values
LGTM!
-------------
Marked as reviewed by ysr (Reviewer).
PR: https://git.openjdk.org/jdk/pull/12091
More information about the shenandoah-dev
mailing list