< prev index next >

src/os/solaris/vm/os_solaris.cpp

Print this page

        

@@ -1116,12 +1116,11 @@
   return &allowdebug_blocked_sigs;
 }
 
 
 void _handle_uncaught_cxx_exception() {
-  VMError err("An uncaught C++ exception");
-  err.report_and_die();
+  VMError::report_and_die("An uncaught C++ exception");
 }
 
 
 // First crack at OS-specific initialization, from inside the new thread.
 void os::initialize_thread(Thread* thr) {

@@ -1328,19 +1327,19 @@
 
 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis
 jlong os::javaTimeMillis() {
   timeval t;
   if (gettimeofday(&t, NULL) == -1) {
-    fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)));
+    fatal("os::javaTimeMillis: gettimeofday (%s)", strerror(errno));
   }
   return jlong(t.tv_sec) * 1000  +  jlong(t.tv_usec) / 1000;
 }
 
 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) {
   timeval t;
   if (gettimeofday(&t, NULL) == -1) {
-    fatal(err_msg("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno)));
+    fatal("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno));
   }
   seconds = jlong(t.tv_sec);
   nanos = jlong(t.tv_usec) * 1000;
 }
 

@@ -2390,18 +2389,18 @@
   assert(mesg != NULL, "mesg must be specified");
   int err = os::Solaris::commit_memory_impl(addr, bytes, exec);
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, bytes, exec, err);
-    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
 size_t os::Solaris::page_size_for_alignment(size_t alignment) {
   assert(is_size_aligned(alignment, (size_t) vm_page_size()),
-         err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT,
-                 alignment, (size_t) vm_page_size()));
+         SIZE_FORMAT " is not aligned to " SIZE_FORMAT,
+         alignment, (size_t) vm_page_size());
 
   for (int i = 0; _page_sizes[i] != 0; i++) {
     if (is_size_aligned(alignment, _page_sizes[i])) {
       return _page_sizes[i];
     }

@@ -2413,11 +2412,11 @@
 int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
                                     size_t alignment_hint, bool exec) {
   int err = Solaris::commit_memory_impl(addr, bytes, exec);
   if (err == 0 && UseLargePages && alignment_hint > 0) {
     assert(is_size_aligned(bytes, alignment_hint),
-           err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint));
+           SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint);
 
     // The syscall memcntl requires an exact page size (see man memcntl for details).
     size_t page_size = page_size_for_alignment(alignment_hint);
     if (page_size > (size_t) vm_page_size()) {
       (void)Solaris::setup_large_pages(addr, bytes, page_size);

@@ -2437,11 +2436,11 @@
   assert(mesg != NULL, "mesg must be specified");
   int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec);
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err);
-    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
 // Uncommit the pages in a specified region.
 void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) {

@@ -2967,15 +2966,15 @@
   }
   return false;
 }
 
 bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) {
-  assert(is_valid_page_size(align), err_msg(SIZE_FORMAT " is not a valid page size", align));
+  assert(is_valid_page_size(align), SIZE_FORMAT " is not a valid page size", align);
   assert(is_ptr_aligned((void*) start, align),
-         err_msg(PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align));
+         PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align);
   assert(is_size_aligned(bytes, align),
-         err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align));
+         SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align);
 
   // Signal to OS that we want large pages for addresses
   // from addr, addr + bytes
   struct memcntl_mha mpss_struct;
   mpss_struct.mha_cmd = MHA_MAPSIZE_VA;

@@ -3954,12 +3953,12 @@
         vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs.");
       }
       // libjsig also interposes the sigaction() call below and saves the
       // old sigaction on it own.
     } else {
-      fatal(err_msg("Encountered unexpected pre-existing sigaction handler "
-                    "%#lx for signal %d.", (long)oldhand, sig));
+      fatal("Encountered unexpected pre-existing sigaction handler "
+            "%#lx for signal %d.", (long)oldhand, sig);
     }
   }
 
   struct sigaction sigAct;
   sigfillset(&(sigAct.sa_mask));

@@ -4401,12 +4400,11 @@
 
   init_random(1234567);
 
   page_size = sysconf(_SC_PAGESIZE);
   if (page_size == -1) {
-    fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)",
-                  strerror(errno)));
+    fatal("os_solaris.cpp: os::init: sysconf failed (%s)", strerror(errno));
   }
   init_page_sizes((size_t) page_size);
 
   Solaris::initialize_system_info();
 

@@ -4414,11 +4412,11 @@
   // if we need them.
   Solaris::misc_sym_init();
 
   int fd = ::open("/dev/zero", O_RDWR);
   if (fd < 0) {
-    fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno)));
+    fatal("os::init: cannot open /dev/zero (%s)", strerror(errno));
   } else {
     Solaris::set_dev_zero_fd(fd);
 
     // Close on exec, child won't inherit.
     fcntl(fd, F_SETFD, FD_CLOEXEC);
< prev index next >