hotspot/src/os/solaris/vm/os_solaris.cpp
changeset 27926 0e2e188ab887
parent 27711 0b952ebd3953
parent 27880 afb974a04396
child 28172 19ae5c844e75
equal deleted inserted replaced
27862:3107be2ba9c6 27926:0e2e188ab887
   504     if (board * processors_per_board + 0 >= limit_id) {
   504     if (board * processors_per_board + 0 >= limit_id) {
   505       board = 0;
   505       board = 0;
   506     }
   506     }
   507   }
   507   }
   508   if (available_id != NULL) {
   508   if (available_id != NULL) {
   509     FREE_C_HEAP_ARRAY(bool, available_id, mtInternal);
   509     FREE_C_HEAP_ARRAY(bool, available_id);
   510   }
   510   }
   511   return true;
   511   return true;
   512 }
   512 }
   513 
   513 
   514 void os::set_native_thread_name(const char *name) {
   514 void os::set_native_thread_name(const char *name) {
   536     } else {
   536     } else {
   537       result = false;
   537       result = false;
   538     }
   538     }
   539   }
   539   }
   540   if (id_array != NULL) {
   540   if (id_array != NULL) {
   541     FREE_C_HEAP_ARRAY(processorid_t, id_array, mtInternal);
   541     FREE_C_HEAP_ARRAY(processorid_t, id_array);
   542   }
   542   }
   543   return result;
   543   return result;
   544 }
   544 }
   545 
   545 
   546 bool os::bind_to_processor(uint processor_id) {
   546 bool os::bind_to_processor(uint processor_id) {
   671     char           *library_path;
   671     char           *library_path;
   672     char           *common_path = buf;
   672     char           *common_path = buf;
   673 
   673 
   674     // Determine search path count and required buffer size.
   674     // Determine search path count and required buffer size.
   675     if (dlinfo(RTLD_SELF, RTLD_DI_SERINFOSIZE, (void *)info) == -1) {
   675     if (dlinfo(RTLD_SELF, RTLD_DI_SERINFOSIZE, (void *)info) == -1) {
   676       FREE_C_HEAP_ARRAY(char, buf, mtInternal);
   676       FREE_C_HEAP_ARRAY(char, buf);
   677       vm_exit_during_initialization("dlinfo SERINFOSIZE request", dlerror());
   677       vm_exit_during_initialization("dlinfo SERINFOSIZE request", dlerror());
   678     }
   678     }
   679 
   679 
   680     // Allocate new buffer and initialize.
   680     // Allocate new buffer and initialize.
   681     info = (Dl_serinfo*)NEW_C_HEAP_ARRAY(char, info_sz.dls_size, mtInternal);
   681     info = (Dl_serinfo*)NEW_C_HEAP_ARRAY(char, info_sz.dls_size, mtInternal);
   682     info->dls_size = info_sz.dls_size;
   682     info->dls_size = info_sz.dls_size;
   683     info->dls_cnt = info_sz.dls_cnt;
   683     info->dls_cnt = info_sz.dls_cnt;
   684 
   684 
   685     // Obtain search path information.
   685     // Obtain search path information.
   686     if (dlinfo(RTLD_SELF, RTLD_DI_SERINFO, (void *)info) == -1) {
   686     if (dlinfo(RTLD_SELF, RTLD_DI_SERINFO, (void *)info) == -1) {
   687       FREE_C_HEAP_ARRAY(char, buf, mtInternal);
   687       FREE_C_HEAP_ARRAY(char, buf);
   688       FREE_C_HEAP_ARRAY(char, info, mtInternal);
   688       FREE_C_HEAP_ARRAY(char, info);
   689       vm_exit_during_initialization("dlinfo SERINFO request", dlerror());
   689       vm_exit_during_initialization("dlinfo SERINFO request", dlerror());
   690     }
   690     }
   691 
   691 
   692     path = &info->dls_serpath[0];
   692     path = &info->dls_serpath[0];
   693 
   693 
   753     // tty->print_raw_cr(library_path);
   753     // tty->print_raw_cr(library_path);
   754 
   754 
   755     // Callee copies into its own buffer.
   755     // Callee copies into its own buffer.
   756     Arguments::set_library_path(library_path);
   756     Arguments::set_library_path(library_path);
   757 
   757 
   758     FREE_C_HEAP_ARRAY(char, library_path, mtInternal);
   758     FREE_C_HEAP_ARRAY(char, library_path);
   759     FREE_C_HEAP_ARRAY(char, info, mtInternal);
   759     FREE_C_HEAP_ARRAY(char, info);
   760   }
   760   }
   761 
   761 
   762   // Extensions directories.
   762   // Extensions directories.
   763   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   763   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   764   Arguments::set_ext_dirs(buf);
   764   Arguments::set_ext_dirs(buf);
   765 
   765 
   766   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
   766   FREE_C_HEAP_ARRAY(char, buf);
   767 
   767 
   768 #undef SYS_EXT_DIR
   768 #undef SYS_EXT_DIR
   769 #undef EXTENSIONS_DIR
   769 #undef EXTENSIONS_DIR
   770 }
   770 }
   771 
   771 
  1590       }
  1590       }
  1591     }
  1591     }
  1592     // release the storage
  1592     // release the storage
  1593     for (int i = 0; i < n; i++) {
  1593     for (int i = 0; i < n; i++) {
  1594       if (pelements[i] != NULL) {
  1594       if (pelements[i] != NULL) {
  1595         FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
  1595         FREE_C_HEAP_ARRAY(char, pelements[i]);
  1596       }
  1596       }
  1597     }
  1597     }
  1598     if (pelements != NULL) {
  1598     if (pelements != NULL) {
  1599       FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
  1599       FREE_C_HEAP_ARRAY(char*, pelements);
  1600     }
  1600     }
  1601   } else {
  1601   } else {
  1602     snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
  1602     snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
  1603     retval = true;
  1603     retval = true;
  1604   }
  1604   }
  4681       UseNUMA = false;
  4681       UseNUMA = false;
  4682     } else {
  4682     } else {
  4683       size_t lgrp_limit = os::numa_get_groups_num();
  4683       size_t lgrp_limit = os::numa_get_groups_num();
  4684       int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
  4684       int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
  4685       size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
  4685       size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
  4686       FREE_C_HEAP_ARRAY(int, lgrp_ids, mtInternal);
  4686       FREE_C_HEAP_ARRAY(int, lgrp_ids);
  4687       if (lgrp_num < 2) {
  4687       if (lgrp_num < 2) {
  4688         // There's only one locality group, disable NUMA.
  4688         // There's only one locality group, disable NUMA.
  4689         UseNUMA = false;
  4689         UseNUMA = false;
  4690       }
  4690       }
  4691     }
  4691     }