| version 1.1, 2008/03/19 07:05:55 |
version 1.3, 2009/03/10 16:36:15 |
|
|
| # $OpenXM$ |
# $OpenXM: OpenXM_contrib2/asir2000/gc6-risa.diff,v 1.2 2009/02/06 08:58:28 ohara Exp $ |
| # Patches depend on Risa/Asir |
# Patches depend on Risa/Asir |
| diff -urN gc6.8/configure gc6.8-risa/configure |
diff -urN gc6.8/configure gc6.8-risa/configure |
| --- gc6.8/configure 2006-03-24 09:42:55.000000000 +0900 |
--- gc6.8/configure 2006-03-24 09:42:55.000000000 +0900 |
| Line 79 diff -urN gc6.8/alloc.c gc6.8-risa/alloc.c |
|
| Line 79 diff -urN gc6.8/alloc.c gc6.8-risa/alloc.c |
|
| if (GC_collect_at_heapsize < GC_heapsize /* wrapped */) |
if (GC_collect_at_heapsize < GC_heapsize /* wrapped */) |
| GC_collect_at_heapsize = (word)(-1); |
GC_collect_at_heapsize = (word)(-1); |
| # endif |
# endif |
| +#if defined(VISUAL_LIB) |
+#if defined(VISUAL) |
| + SendHeapSize(); |
+ SendHeapSize(); |
| +#endif |
+#endif |
| return(TRUE); |
return(TRUE); |
| Line 127 diff -urN gc6.8/reclaim.c gc6.8-risa/reclaim.c |
|
| Line 127 diff -urN gc6.8/reclaim.c gc6.8-risa/reclaim.c |
|
| # ifdef PRINTTIMES |
# ifdef PRINTTIMES |
| GET_TIME(done_time); |
GET_TIME(done_time); |
| GC_printf1("Disposing of reclaim lists took %lu msecs\n", |
GC_printf1("Disposing of reclaim lists took %lu msecs\n", |
| |
--- gc6.8/misc.c 2006-02-11 04:38:46.000000000 +0900 |
| |
+++ gc6.8-risa/misc.c 2009-02-06 16:30:52.000000000 +0900 |
| |
@@ -143,6 +143,93 @@ |
| |
long GC_large_alloc_warn_suppressed = 0; |
| |
/* Number of warnings suppressed so far. */ |
| |
|
| |
+#include <time.h> |
| |
+ |
| |
+#if defined(VISUAL) |
| |
+#include <windows.h> |
| |
+ |
| |
+static double get_clock() |
| |
+{ |
| |
+ static int initialized = 0; |
| |
+ static int is_winnt = 0; |
| |
+ static HANDLE curproc; |
| |
+ |
| |
+ if ( !initialized ) { |
| |
+ OSVERSIONINFO vinfo; |
| |
+ |
| |
+ curproc = GetCurrentProcess(); |
| |
+ vinfo.dwOSVersionInfoSize = sizeof(vinfo); |
| |
+ GetVersionEx(&vinfo); |
| |
+ if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) |
| |
+ is_winnt = 1; |
| |
+ else |
| |
+ is_winnt = 0; |
| |
+ } |
| |
+ if ( is_winnt ) { |
| |
+ FILETIME c,e,k,u; |
| |
+ |
| |
+ GetProcessTimes(curproc,&c,&e,&k,&u); |
| |
+ return ((double)k.dwLowDateTime+(double)u.dwLowDateTime |
| |
+ +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0; |
| |
+ } else |
| |
+// return (double)clock()/(double)CLOCKS_PER_SEC; |
| |
+ return ((double)GetTickCount())/1000.0; |
| |
+} |
| |
+ |
| |
+#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32) |
| |
+ |
| |
+static double get_clock() |
| |
+{ |
| |
+ clock_t c; |
| |
+ |
| |
+ c = clock(); |
| |
+ return (double)c/(double)CLOCKS_PER_SEC; |
| |
+} |
| |
+ |
| |
+#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__) |
| |
+ |
| |
+#include <sys/time.h> |
| |
+#include <limits.h> |
| |
+ |
| |
+static double get_clock() |
| |
+{ |
| |
+ struct tms buf; |
| |
+ |
| |
+ times(&buf); |
| |
+ return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK; |
| |
+} |
| |
+ |
| |
+#else |
| |
+ |
| |
+#include <sys/time.h> |
| |
+#include <sys/resource.h> |
| |
+ |
| |
+static double get_clock() |
| |
+{ |
| |
+ int tv_sec,tv_usec; |
| |
+ struct rusage ru; |
| |
+ |
| |
+ getrusage(RUSAGE_SELF,&ru); |
| |
+ tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec; |
| |
+ tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec; |
| |
+ return (double)tv_sec+(double)tv_usec/(double)1000000; |
| |
+} |
| |
+#endif |
| |
+ |
| |
+static double gctime, gcstart; |
| |
+ |
| |
+void GC_timerstart() { |
| |
+ gcstart = get_clock(); |
| |
+} |
| |
+ |
| |
+void GC_timerstop() { |
| |
+ gctime += get_clock() - gcstart; |
| |
+} |
| |
+ |
| |
+double GC_get_gctime() { |
| |
+ return gctime; |
| |
+} |
| |
+ |
| |
/*ARGSUSED*/ |
| |
GC_PTR GC_default_oom_fn GC_PROTO((size_t bytes_requested)) |
| |
{ |