2569 // Map uncommitted pages PROT_NONE so we fail early if we touch an
2570 // uncommitted page. Otherwise, the read/write might succeed if we
2571 // have enough swap space to back the physical page.
2572 return mmap_chunk(addr, bytes, flags, PROT_NONE);
2573 }
2574
2575 char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
2576 size_t alignment_hint) {
2577 char* addr = Solaris::anon_mmap(requested_addr, bytes, alignment_hint,
2578 (requested_addr != NULL));
2579
2580 guarantee(requested_addr == NULL || requested_addr == addr,
2581 "OS failed to return requested mmap address.");
2582 return addr;
2583 }
2584
2585 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int file_desc) {
2586 assert(file_desc >= 0, "file_desc is not valid");
2587 char* result = pd_attempt_reserve_memory_at(bytes, requested_addr);
2588 if (result != NULL) {
2589 if (replace_existing_mapping_with_dax_file_mapping(result, bytes, file_desc) == NULL) {
2590 vm_exit_during_initialization(err_msg("Error in mapping Java heap at the given filesystem directory"));
2591 }
2592 }
2593 return result;
2594 }
2595
2596 // Reserve memory at an arbitrary address, only if that area is
2597 // available (and not reserved for something else).
2598
2599 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
2600 const int max_tries = 10;
2601 char* base[max_tries];
2602 size_t size[max_tries];
2603
2604 // Solaris adds a gap between mmap'ed regions. The size of the gap
2605 // is dependent on the requested size and the MMU. Our initial gap
2606 // value here is just a guess and will be corrected later.
2607 bool had_top_overlap = false;
2608 bool have_adjusted_gap = false;
2609 size_t gap = 0x400000;
|
2569 // Map uncommitted pages PROT_NONE so we fail early if we touch an
2570 // uncommitted page. Otherwise, the read/write might succeed if we
2571 // have enough swap space to back the physical page.
2572 return mmap_chunk(addr, bytes, flags, PROT_NONE);
2573 }
2574
2575 char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
2576 size_t alignment_hint) {
2577 char* addr = Solaris::anon_mmap(requested_addr, bytes, alignment_hint,
2578 (requested_addr != NULL));
2579
2580 guarantee(requested_addr == NULL || requested_addr == addr,
2581 "OS failed to return requested mmap address.");
2582 return addr;
2583 }
2584
2585 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int file_desc) {
2586 assert(file_desc >= 0, "file_desc is not valid");
2587 char* result = pd_attempt_reserve_memory_at(bytes, requested_addr);
2588 if (result != NULL) {
2589 if (replace_existing_mapping_with_file_mapping(result, bytes, file_desc) == NULL) {
2590 vm_exit_during_initialization(err_msg("Error in mapping Java heap at the given filesystem directory"));
2591 }
2592 }
2593 return result;
2594 }
2595
2596 // Reserve memory at an arbitrary address, only if that area is
2597 // available (and not reserved for something else).
2598
2599 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
2600 const int max_tries = 10;
2601 char* base[max_tries];
2602 size_t size[max_tries];
2603
2604 // Solaris adds a gap between mmap'ed regions. The size of the gap
2605 // is dependent on the requested size and the MMU. Our initial gap
2606 // value here is just a guess and will be corrected later.
2607 bool had_top_overlap = false;
2608 bool have_adjusted_gap = false;
2609 size_t gap = 0x400000;
|