Many APIs in the "os" class (e.g, os::vm_page_size()) return information about the OS that's collected during VM bootstrap and never changes afterwards.
Add a new OSInfo API to access such information efficiently, and simplify the per-OS implementation:
class OSInfo : AllStatic {
static int _vm_page_size;
static int _vm_allocation_granularity;
[... more ...]
public:
// Returns the byte size of a virtual memory page
static int vm_page_size() { return _vm_page_size; }
// Returns the size in bytes of memory blocks which can be allocated.
static int vm_allocation_granularity() { return _vm_allocation_granularity; }
static void set_vm_page_size(int n) {
assert(_vm_page_size < 0, "init only once");
assert(n > 0, "sanity");
_vm_page_size = n;
}
static void set_vm_allocation_granularity(int n) {
assert(_vm_allocation_granularity < 0, "init only once");
assert(n > 0, "sanity");
_vm_allocation_granularity = n;
}
[... more ...]
Add a new OSInfo API to access such information efficiently, and simplify the per-OS implementation:
class OSInfo : AllStatic {
static int _vm_page_size;
static int _vm_allocation_granularity;
[... more ...]
public:
// Returns the byte size of a virtual memory page
static int vm_page_size() { return _vm_page_size; }
// Returns the size in bytes of memory blocks which can be allocated.
static int vm_allocation_granularity() { return _vm_allocation_granularity; }
static void set_vm_page_size(int n) {
assert(_vm_page_size < 0, "init only once");
assert(n > 0, "sanity");
_vm_page_size = n;
}
static void set_vm_allocation_granularity(int n) {
assert(_vm_allocation_granularity < 0, "init only once");
assert(n > 0, "sanity");
_vm_allocation_granularity = n;
}
[... more ...]
- duplicates
-
JDK-8290840 Refactor the "os" class
- Resolved
- relates to
-
JDK-8292608 [AIX] Broken build after 8291945
- Resolved