src/os/solaris/vm/os_solaris.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File linux-numa-bad-mmap Sdiff src/os/solaris/vm

src/os/solaris/vm/os_solaris.cpp

Print this page




2804       size_t page_size = 0;
2805       if (large_page_size() < alignment_hint) {
2806         assert(UseLargePages, "Expected to be here for large page use only");
2807         page_size = large_page_size();
2808       } else {
2809         // If the alignment hint is less than the large page
2810         // size, the VM wants a particular alignment (thus the hint)
2811         // for internal reasons.  Try to set the mpss range using
2812         // the alignment_hint.
2813         page_size = alignment_hint;
2814       }
2815       // Since this is a hint, ignore any failures.
2816       (void)Solaris::set_mpss_range(addr, bytes, page_size);
2817     }
2818     return true;
2819   }
2820   return false;
2821 }
2822 
2823 // Uncommit the pages in a specified region.
2824 void os::free_memory(char* addr, size_t bytes) {
2825   if (madvise(addr, bytes, MADV_FREE) < 0) {
2826     debug_only(warning("MADV_FREE failed."));
2827     return;
2828   }
2829 }
2830 
2831 bool os::create_stack_guard_pages(char* addr, size_t size) {
2832   return os::commit_memory(addr, size);
2833 }
2834 
2835 bool os::remove_stack_guard_pages(char* addr, size_t size) {
2836   return os::uncommit_memory(addr, size);
2837 }
2838 
2839 // Change the page size in a given range.
2840 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2841   assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
2842   assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
2843   if (UseLargePages && UseMPSS) {
2844     Solaris::set_mpss_range(addr, bytes, alignment_hint);




2804       size_t page_size = 0;
2805       if (large_page_size() < alignment_hint) {
2806         assert(UseLargePages, "Expected to be here for large page use only");
2807         page_size = large_page_size();
2808       } else {
2809         // If the alignment hint is less than the large page
2810         // size, the VM wants a particular alignment (thus the hint)
2811         // for internal reasons.  Try to set the mpss range using
2812         // the alignment_hint.
2813         page_size = alignment_hint;
2814       }
2815       // Since this is a hint, ignore any failures.
2816       (void)Solaris::set_mpss_range(addr, bytes, page_size);
2817     }
2818     return true;
2819   }
2820   return false;
2821 }
2822 
2823 // Uncommit the pages in a specified region.
2824 void os::free_memory(char* addr, size_t bytes, size_t alignment_hint) {
2825   if (madvise(addr, bytes, MADV_FREE) < 0) {
2826     debug_only(warning("MADV_FREE failed."));
2827     return;
2828   }
2829 }
2830 
2831 bool os::create_stack_guard_pages(char* addr, size_t size) {
2832   return os::commit_memory(addr, size);
2833 }
2834 
2835 bool os::remove_stack_guard_pages(char* addr, size_t size) {
2836   return os::uncommit_memory(addr, size);
2837 }
2838 
2839 // Change the page size in a given range.
2840 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2841   assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
2842   assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
2843   if (UseLargePages && UseMPSS) {
2844     Solaris::set_mpss_range(addr, bytes, alignment_hint);


src/os/solaris/vm/os_solaris.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File