RFR: 8151413: os::allocation_granularity/page_size and friends return signed values [v8]

Afshin Zafari duke at openjdk.org
Mon Jan 23 09:22:11 UTC 2023


> ### 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

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/12091/files
  - new: https://git.openjdk.org/jdk/pull/12091/files/b91290bc..2f58d7e1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12091&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12091&range=06-07

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12091.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12091/head:pull/12091

PR: https://git.openjdk.org/jdk/pull/12091


More information about the shenandoah-dev mailing list