*/
GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
{
- CLOCK_TYPE start_time, current_time;
+ CLOCK_TYPE start_time = CLOCK_ZERO;
+ CLOCK_TYPE current_time;
if (GC_dont_gc) return FALSE;
/* PLTSCHEME */
if (GC_collect_start_callback)
{
unsigned i;
int dummy;
- CLOCK_TYPE start_time, current_time;
+ CLOCK_TYPE start_time = CLOCK_ZERO;
+ CLOCK_TYPE current_time;
if (GC_print_stats)
GET_TIME(start_time);
/* but the world is otherwise running. */
void GC_finish_collection()
{
- CLOCK_TYPE start_time;
- CLOCK_TYPE finalize_time;
+ CLOCK_TYPE start_time = CLOCK_ZERO;
+ CLOCK_TYPE finalize_time = CLOCK_ZERO;
CLOCK_TYPE done_time;
# if defined(GC_ASSERTIONS) && defined(THREADS) \
#ifdef BSD_TIME
# undef CLOCK_TYPE
+# undef CLOCK_ZERO
# undef GET_TIME
# undef MS_TIME_DIFF
# define CLOCK_TYPE struct timeval
+# define CLOCK_ZERO {0, 0}
# define GET_TIME(x) { struct rusage rusage; \
getrusage (RUSAGE_SELF, &rusage); \
x = rusage.ru_utime; }
# include <windows.h>
# include <winbase.h>
# define CLOCK_TYPE DWORD
+# define CLOCK_ZERO 0
# define GET_TIME(x) x = GetTickCount()
# define MS_TIME_DIFF(a,b) ((long)((a)-(b)))
# else /* !MSWIN32, !MSWINCE, !BSD_TIME */
*/
# endif
# define CLOCK_TYPE clock_t
+# define CLOCK_ZERO 0
# define GET_TIME(x) x = clock()
# define MS_TIME_DIFF(a,b) ((unsigned long) \
(1000.0*(double)((a)-(b))/(double)CLOCKS_PER_SEC))