Annotation of OpenXM_contrib2/asir2018/gc6-risa.diff, Revision 1.1
1.1 ! noro 1: # $OpenXM$
! 2: # Patches depend on Risa/Asir
! 3: diff -urN gc6.8/configure gc6.8-risa/configure
! 4: --- gc6.8/configure 2006-03-24 09:42:55.000000000 +0900
! 5: +++ gc6.8-risa/configure 2008-03-19 13:31:36.000000000 +0900
! 6: @@ -9628,7 +9628,7 @@
! 7: _ACEOF
! 8:
! 9: cat >>confdefs.h <<\_ACEOF
! 10: -#define NO_SIGNALS 1
! 11: +##define NO_SIGNALS 1
! 12: _ACEOF
! 13:
! 14: cat >>confdefs.h <<\_ACEOF
! 15: diff -urN gc6.8/alloc.c gc6.8-risa/alloc.c
! 16: --- gc6.8/alloc.c 2005-10-29 09:03:26.000000000 +0900
! 17: +++ gc6.8-risa/alloc.c 2008-03-19 13:50:20.000000000 +0900
! 18: @@ -110,6 +110,7 @@
! 19: GC_bool GC_dont_expand = 0;
! 20:
! 21: word GC_free_space_divisor = 3;
! 22: +word GC_free_space_numerator = 1;
! 23:
! 24: extern GC_bool GC_collection_in_progress();
! 25: /* Collection is in progress, or was abandoned. */
! 26: @@ -174,9 +175,9 @@
! 27: /* use a bit more of large empty heap */
! 28: + total_root_size);
! 29: if (TRUE_INCREMENTAL) {
! 30: - return scan_size / (2 * GC_free_space_divisor);
! 31: + return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor);
! 32: } else {
! 33: - return scan_size / GC_free_space_divisor;
! 34: + return scan_size * GC_free_space_numerator / GC_free_space_divisor;
! 35: }
! 36: }
! 37:
! 38: @@ -492,6 +493,7 @@
! 39: # if defined(REGISTER_LIBRARIES_EARLY)
! 40: GC_cond_register_dynamic_libraries();
! 41: # endif
! 42: + GC_timerstart();
! 43: STOP_WORLD();
! 44: IF_THREADS(GC_world_stopped = TRUE);
! 45: # ifdef CONDPRINT
! 46: @@ -526,6 +528,7 @@
! 47: GC_deficit = i; /* Give the mutator a chance. */
! 48: IF_THREADS(GC_world_stopped = FALSE);
! 49: START_WORLD();
! 50: + GC_timerstop();
! 51: return(FALSE);
! 52: }
! 53: if (GC_mark_some((ptr_t)(&dummy))) break;
! 54: @@ -560,6 +563,7 @@
! 55:
! 56: IF_THREADS(GC_world_stopped = FALSE);
! 57: START_WORLD();
! 58: + GC_timerstop();
! 59: # ifdef PRINTTIMES
! 60: GET_TIME(current_time);
! 61: GC_printf1("World-stopped marking took %lu msecs\n",
! 62: @@ -640,6 +644,7 @@
! 63: GET_TIME(start_time);
! 64: finalize_time = start_time;
! 65: # endif
! 66: + GC_timerstart();
! 67:
! 68: # ifdef GATHERSTATS
! 69: GC_mem_found = 0;
! 70: @@ -757,6 +762,7 @@
! 71: MS_TIME_DIFF(finalize_time,start_time),
! 72: MS_TIME_DIFF(done_time,finalize_time));
! 73: # endif
! 74: + GC_timerstop();
! 75: }
! 76:
! 77: /* Externally callable routine to invoke full, stop-world collection */
! 78: @@ -971,6 +977,9 @@
! 79: if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
! 80: GC_collect_at_heapsize = (word)(-1);
! 81: # endif
! 82: +#if defined(VISUAL)
! 83: + SendHeapSize();
! 84: +#endif
! 85: return(TRUE);
! 86: }
! 87:
! 88: @@ -1067,6 +1076,22 @@
! 89:
! 90: if (sz == 0) return(0);
! 91:
! 92: +#if defined(VISUAL)
! 93: + {
! 94: +#include <signal.h>
! 95: + extern int recv_intr;
! 96: + if ( recv_intr ) {
! 97: + if ( recv_intr == 1 ) {
! 98: + recv_intr = 0;
! 99: + int_handler();
! 100: + } else {
! 101: + recv_intr = 0;
! 102: + ox_usr1_handler(0);
! 103: + }
! 104: + }
! 105: + }
! 106: +#endif
! 107: +
! 108: while (*flh == 0) {
! 109: ENTER_GC();
! 110: /* Do our share of marking work */
! 111: diff -urN gc6.8/reclaim.c gc6.8-risa/reclaim.c
! 112: --- gc6.8/reclaim.c 2004-11-23 02:58:18.000000000 +0900
! 113: +++ gc6.8-risa/reclaim.c 2008-03-19 13:50:56.000000000 +0900
! 114: @@ -1030,6 +1030,7 @@
! 115:
! 116: GET_TIME(start_time);
! 117: # endif
! 118: + GC_timerstart();
! 119:
! 120: for (kind = 0; kind < GC_n_kinds; kind++) {
! 121: ok = &(GC_obj_kinds[kind]);
! 122: @@ -1052,6 +1053,7 @@
! 123: }
! 124: }
! 125: }
! 126: + GC_timerstop();
! 127: # ifdef PRINTTIMES
! 128: GET_TIME(done_time);
! 129: GC_printf1("Disposing of reclaim lists took %lu msecs\n",
! 130: --- gc6.8/misc.c 2006-02-11 04:38:46.000000000 +0900
! 131: +++ gc6.8-risa/misc.c 2009-02-06 16:30:52.000000000 +0900
! 132: @@ -143,6 +143,93 @@
! 133: long GC_large_alloc_warn_suppressed = 0;
! 134: /* Number of warnings suppressed so far. */
! 135:
! 136: +#include <time.h>
! 137: +
! 138: +#if defined(VISUAL)
! 139: +#include <windows.h>
! 140: +
! 141: +static double get_clock()
! 142: +{
! 143: + static int initialized = 0;
! 144: + static int is_winnt = 0;
! 145: + static HANDLE curproc;
! 146: +
! 147: + if ( !initialized ) {
! 148: + OSVERSIONINFO vinfo;
! 149: +
! 150: + curproc = GetCurrentProcess();
! 151: + vinfo.dwOSVersionInfoSize = sizeof(vinfo);
! 152: + GetVersionEx(&vinfo);
! 153: + if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
! 154: + is_winnt = 1;
! 155: + else
! 156: + is_winnt = 0;
! 157: + }
! 158: + if ( is_winnt ) {
! 159: + FILETIME c,e,k,u;
! 160: +
! 161: + GetProcessTimes(curproc,&c,&e,&k,&u);
! 162: + return ((double)k.dwLowDateTime+(double)u.dwLowDateTime
! 163: + +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0;
! 164: + } else
! 165: +// return (double)clock()/(double)CLOCKS_PER_SEC;
! 166: + return ((double)GetTickCount())/1000.0;
! 167: +}
! 168: +
! 169: +#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32)
! 170: +
! 171: +static double get_clock()
! 172: +{
! 173: + clock_t c;
! 174: +
! 175: + c = clock();
! 176: + return (double)c/(double)CLOCKS_PER_SEC;
! 177: +}
! 178: +
! 179: +#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__)
! 180: +
! 181: +#include <sys/times.h>
! 182: +#include <limits.h>
! 183: +
! 184: +static double get_clock()
! 185: +{
! 186: + struct tms buf;
! 187: +
! 188: + times(&buf);
! 189: + return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK;
! 190: +}
! 191: +
! 192: +#else
! 193: +
! 194: +#include <sys/time.h>
! 195: +#include <sys/resource.h>
! 196: +
! 197: +static double get_clock()
! 198: +{
! 199: + int tv_sec,tv_usec;
! 200: + struct rusage ru;
! 201: +
! 202: + getrusage(RUSAGE_SELF,&ru);
! 203: + tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
! 204: + tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
! 205: + return (double)tv_sec+(double)tv_usec/(double)1000000;
! 206: +}
! 207: +#endif
! 208: +
! 209: +static double gctime, gcstart;
! 210: +
! 211: +void GC_timerstart() {
! 212: + gcstart = get_clock();
! 213: +}
! 214: +
! 215: +void GC_timerstop() {
! 216: + gctime += get_clock() - gcstart;
! 217: +}
! 218: +
! 219: +double GC_get_gctime() {
! 220: + return gctime;
! 221: +}
! 222: +
! 223: /*ARGSUSED*/
! 224: GC_PTR GC_default_oom_fn GC_PROTO((size_t bytes_requested))
! 225: {
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>