2818 (uintptr_t) ::mmap(addr, size, prot,
2819 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
2820 -1, 0);
2821 return res != (uintptr_t) MAP_FAILED;
2822 }
2823 #endif
2824
2825 return commit_memory(addr, size, exec);
2826 }
2827
2828 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2829 #ifndef _ALLBSD_SOURCE
2830 if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
2831 // We don't check the return value: madvise(MADV_HUGEPAGE) may not
2832 // be supported or the memory may already be backed by huge pages.
2833 ::madvise(addr, bytes, MADV_HUGEPAGE);
2834 }
2835 #endif
2836 }
2837
2838 void os::free_memory(char *addr, size_t bytes) {
2839 ::madvise(addr, bytes, MADV_DONTNEED);
2840 }
2841
2842 void os::numa_make_global(char *addr, size_t bytes) {
2843 }
2844
2845 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) {
2846 }
2847
2848 bool os::numa_topology_changed() { return false; }
2849
2850 size_t os::numa_get_groups_num() {
2851 return 1;
2852 }
2853
2854 int os::numa_get_group_id() {
2855 return 0;
2856 }
2857
2858 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
|
2818 (uintptr_t) ::mmap(addr, size, prot,
2819 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
2820 -1, 0);
2821 return res != (uintptr_t) MAP_FAILED;
2822 }
2823 #endif
2824
2825 return commit_memory(addr, size, exec);
2826 }
2827
2828 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2829 #ifndef _ALLBSD_SOURCE
2830 if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
2831 // We don't check the return value: madvise(MADV_HUGEPAGE) may not
2832 // be supported or the memory may already be backed by huge pages.
2833 ::madvise(addr, bytes, MADV_HUGEPAGE);
2834 }
2835 #endif
2836 }
2837
2838 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
2839 ::madvise(addr, bytes, MADV_DONTNEED);
2840 }
2841
2842 void os::numa_make_global(char *addr, size_t bytes) {
2843 }
2844
2845 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) {
2846 }
2847
2848 bool os::numa_topology_changed() { return false; }
2849
2850 size_t os::numa_get_groups_num() {
2851 return 1;
2852 }
2853
2854 int os::numa_get_group_id() {
2855 return 0;
2856 }
2857
2858 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
|