Annotation of OpenXM_contrib2/asir2000/gc-7.0-risa.diff, Revision 1.11
1.11 ! ohara 1: diff -urN gc-7.4.2.orig/alloc.c gc-7.4.2/alloc.c
! 2: --- gc-7.4.2.orig/alloc.c 2014-06-03 15:08:01.000000000 +0900
! 3: +++ gc-7.4.2/alloc.c 2015-08-04 14:17:41.000000000 +0900
1.7 ohara 4: @@ -121,6 +121,7 @@
5: #endif
1.1 ohara 6:
1.7 ohara 7: word GC_free_space_divisor = GC_FREE_SPACE_DIVISOR;
1.1 ohara 8: +word GC_free_space_numerator = 1;
9:
1.7 ohara 10: GC_INNER int GC_CALLBACK GC_never_stop_func(void)
11: {
1.11 ! ohara 12: @@ -228,7 +229,7 @@
1.7 ohara 13: scan_size = 2 * GC_composite_in_use + GC_atomic_in_use / 4
1.11 ! ohara 14: + total_root_size;
! 15: result = scan_size / GC_free_space_divisor;
! 16: - if (GC_incremental) {
! 17: + if (1 || GC_incremental) {
! 18: result /= 2;
1.1 ohara 19: }
1.11 ! ohara 20: return result > 0 ? result : 1;
! 21: @@ -603,6 +604,7 @@
1.7 ohara 22: GET_TIME(start_time);
1.1 ohara 23: # endif
1.7 ohara 24:
1.1 ohara 25: + GC_timerstart();
26: STOP_WORLD();
1.7 ohara 27: # ifdef THREAD_LOCAL_ALLOC
28: GC_world_stopped = TRUE;
1.11 ! ohara 29: @@ -632,6 +634,7 @@
1.7 ohara 30: GC_world_stopped = FALSE;
31: # endif
1.10 ohara 32: START_WORLD();
33: + GC_timerstop();
34: return(FALSE);
35: }
1.11 ! ohara 36: if (GC_mark_some(GC_approx_sp())) break;
! 37: @@ -653,6 +656,7 @@
1.7 ohara 38: GC_world_stopped = FALSE;
39: # endif
1.1 ohara 40: START_WORLD();
41: + GC_timerstop();
1.7 ohara 42: # ifndef SMALL_CONFIG
1.11 ! ohara 43: if (GC_PRINT_STATS_FLAG) {
1.7 ohara 44: unsigned long time_diff;
1.11 ! ohara 45: @@ -836,6 +840,7 @@
! 46: /* FIXME: Add more checks. */
1.1 ohara 47: GC_check_tls();
48: # endif
49: + GC_timerstart();
50:
1.7 ohara 51: # ifndef SMALL_CONFIG
1.11 ! ohara 52: if (GC_print_stats)
! 53: @@ -958,6 +963,7 @@
! 54: MS_TIME_DIFF(done_time,finalize_time));
! 55: }
1.7 ohara 56: # endif
1.1 ohara 57: + GC_timerstop();
58: }
59:
1.7 ohara 60: /* If stop_func == 0 then GC_default_stop_func is used instead. */
1.11 ! ohara 61: @@ -1215,6 +1221,9 @@
! 62: if (GC_on_heap_resize)
! 63: (*GC_on_heap_resize)(GC_heapsize);
! 64:
1.3 ohara 65: +#if defined(VISUAL)
1.1 ohara 66: + SendHeapSize();
67: +#endif
68: return(TRUE);
69: }
70:
1.11 ! ohara 71: @@ -1334,6 +1343,21 @@
1.7 ohara 72: GC_bool retry = FALSE;
1.11 ! ohara 73:
1.1 ohara 74: if (gran == 0) return(0);
1.2 ohara 75: +#if defined(_MSC_VER)
1.1 ohara 76: + {
77: +#include <signal.h>
78: + extern int recv_intr;
79: + if ( recv_intr ) {
80: + if ( recv_intr == 1 ) {
81: + recv_intr = 0;
82: + int_handler();
83: + } else {
84: + recv_intr = 0;
85: + ox_usr1_handler(0);
86: + }
87: + }
88: + }
89: +#endif
1.7 ohara 90:
1.1 ohara 91: while (*flh == 0) {
92: ENTER_GC();
1.11 ! ohara 93: diff -urN gc-7.4.2.orig/misc.c gc-7.4.2/misc.c
! 94: --- gc-7.4.2.orig/misc.c 2014-06-03 15:08:02.000000000 +0900
! 95: +++ gc-7.4.2/misc.c 2015-08-04 14:21:02.000000000 +0900
! 96: @@ -161,6 +161,94 @@
1.7 ohara 97: GC_INNER long GC_large_alloc_warn_interval = GC_LARGE_ALLOC_WARN_INTERVAL;
98: /* Interval between unsuppressed warnings. */
1.2 ohara 99:
100: +#include <time.h>
101: +
102: +#if defined(_MSC_VER)
103: +#include <windows.h>
104: +
105: +static double get_clock()
106: +{
107: + static int initialized = 0;
108: + static int is_winnt = 0;
109: + static HANDLE curproc;
110: +
111: + if ( !initialized ) {
112: + OSVERSIONINFO vinfo;
113: +
114: + curproc = GetCurrentProcess();
115: + vinfo.dwOSVersionInfoSize = sizeof(vinfo);
116: + GetVersionEx(&vinfo);
117: + if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
118: + is_winnt = 1;
119: + else
120: + is_winnt = 0;
121: + }
122: + if ( is_winnt ) {
123: + FILETIME c,e,k,u;
124: +
125: + GetProcessTimes(curproc,&c,&e,&k,&u);
126: + return ((double)k.dwLowDateTime+(double)u.dwLowDateTime
127: + +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0;
128: + } else
129: +// return (double)clock()/(double)CLOCKS_PER_SEC;
130: + return ((double)GetTickCount())/1000.0;
131: +}
132: +
133: +#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32)
134: +
135: +static double get_clock()
136: +{
137: + clock_t c;
138: +
139: + c = clock();
140: + return (double)c/(double)CLOCKS_PER_SEC;
141: +}
142: +
143: +#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__)
144: +
1.4 noro 145: +#include <sys/times.h>
1.2 ohara 146: +#include <limits.h>
147: +
148: +static double get_clock()
149: +{
150: + struct tms buf;
151: +
152: + times(&buf);
153: + return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK;
154: +}
155: +
156: +#else
157: +
158: +#include <sys/time.h>
159: +#include <sys/resource.h>
160: +
161: +static double get_clock()
162: +{
163: + int tv_sec,tv_usec;
164: + struct rusage ru;
165: +
166: + getrusage(RUSAGE_SELF,&ru);
167: + tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
168: + tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
169: + return (double)tv_sec+(double)tv_usec/(double)1000000;
170: +}
171: +#endif
172: +
173: +static double gctime, gcstart;
174: +
175: +void GC_timerstart() {
176: + gcstart = get_clock();
177: +}
178: +
179: +void GC_timerstop() {
180: + gctime += get_clock() - gcstart;
181: +}
182: +
183: +double GC_get_gctime() {
184: + return gctime;
185: +}
186: +
1.11 ! ohara 187: +
! 188: STATIC void * GC_CALLBACK GC_default_oom_fn(
! 189: size_t bytes_requested GC_ATTR_UNUSED)
1.2 ohara 190: {
1.11 ! ohara 191: diff -urN gc-7.4.2.orig/reclaim.c gc-7.4.2/reclaim.c
! 192: --- gc-7.4.2.orig/reclaim.c 2014-06-03 15:08:02.000000000 +0900
! 193: +++ gc-7.4.2/reclaim.c 2015-08-04 14:12:42.000000000 +0900
! 194: @@ -706,6 +706,7 @@
1.7 ohara 195:
196: if (GC_print_stats == VERBOSE)
197: GET_TIME(start_time);
198: + GC_timerstart();
199: # endif
200:
201: for (kind = 0; kind < GC_n_kinds; kind++) {
1.11 ! ohara 202: @@ -730,6 +731,7 @@
1.7 ohara 203: }
204: }
205: # ifndef SMALL_CONFIG
206: + GC_timerstop();
207: if (GC_print_stats == VERBOSE) {
208: GET_TIME(done_time);
1.11 ! ohara 209: GC_verbose_log_printf("Disposing of reclaim lists took %lu msecs\n",
! 210: diff -urN gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE
! 211: --- gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900
! 212: +++ gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900
1.8 ohara 213: @@ -22,13 +22,13 @@
214: all: gctest.exe cord\de.exe test_cpp.exe
215:
216: .c.obj:
217: - $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj /wd4701
218: + $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE -DLARGE_CONFIG $*.c /Fo$*.obj /wd4701
219: # Disable "may not be initialized" warnings. They're too approximate.
220: # Disable crt security warnings, since unfortunately they warn about all sorts
221: # of safe uses of strncpy. It would be nice to leave the rest enabled.
222:
223: .cpp.obj:
224: - $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE $*.cpp /Fo$*.obj
225: + $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE -DLARGE_CONFIG $*.cpp /Fo$*.obj
226:
1.11 ! ohara 227: $(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\gc_disclaim.h include\private\msvc_dbg.h
1.8 ohara 228:
1.11 ! ohara 229: diff -urN gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_STATIC_THREADS_MAKEFILE
! 230: --- gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900
! 231: +++ gc-7.4.2/NT_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900
1.9 ohara 232: @@ -22,10 +22,10 @@
233: all: gctest.exe cord\de.exe test_cpp.exe
234:
235: .c.obj:
236: - $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj
237: + $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -D_CRT_SECURE_NO_DEPRECATE -DLARGE_CONFIG $*.c /Fo$*.obj
238:
239: .cpp.obj:
240: - $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE $*.cpp /Fo$*.obj
241: + $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE -DLARGE_CONFIG $*.cpp /Fo$*.obj
242:
1.11 ! ohara 243: $(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\gc_disclaim.h include\private\msvc_dbg.h
1.9 ohara 244:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>