Bug 522375 - built-in startup time measurement. overflow fix on mac r+a=Mossop
authorTaras Glek <tglek@mozilla.com>
Thu, 13 Jan 2011 13:35:28 -0800
changeset 60460 183d1071f07e5720aa5d25a8b51cbcb255806b2f
parent 60459 19565050334a4029df04a493e3736abd4810d38d
child 60461 8b54bbf7d3a0cb5a900dd02095399bd01233f3d3
push id18003
push usertglek@mozilla.com
push dateThu, 13 Jan 2011 21:35:41 +0000
treeherdermozilla-central@183d1071f07e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs522375
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 522375 - built-in startup time measurement. overflow fix on mac r+a=Mossop
toolkit/components/startup/src/nsAppStartup.cpp
--- a/toolkit/components/startup/src/nsAppStartup.cpp
+++ b/toolkit/components/startup/src/nsAppStartup.cpp
@@ -626,17 +626,17 @@ CalculateProcessCreationTimestamp()
   if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0))
     return 0;
 
   struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size);  
   if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) {
     free(proc);
     return 0;
   }
-  PRTime starttime = proc->kp_proc.p_un.__p_starttime.tv_sec * PR_USEC_PER_SEC;
+  PRTime starttime = static_cast<PRTime>(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC;
   starttime += proc->kp_proc.p_un.__p_starttime.tv_usec;
   free(proc);
   return starttime;
 }
 #else
 static PRTime
 CalculateProcessCreationTimestamp()
 {