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