Annotation of OpenXM_contrib2/asir2000/gc-7.0-risa.diff, Revision 1.17
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: diff -urN gc-7.4.2.orig/misc.c gc-7.4.2/misc.c
83: --- gc-7.4.2.orig/misc.c 2014-06-03 15:08:02.000000000 +0900
84: +++ gc-7.4.2/misc.c 2015-08-04 14:21:02.000000000 +0900
85: @@ -161,6 +161,94 @@
1.7 ohara 86: GC_INNER long GC_large_alloc_warn_interval = GC_LARGE_ALLOC_WARN_INTERVAL;
87: /* Interval between unsuppressed warnings. */
1.2 ohara 88:
89: +#include <time.h>
90: +
91: +#if defined(_MSC_VER)
92: +#include <windows.h>
93: +
94: +static double get_clock()
95: +{
96: + static int initialized = 0;
97: + static int is_winnt = 0;
98: + static HANDLE curproc;
99: +
100: + if ( !initialized ) {
101: + OSVERSIONINFO vinfo;
102: +
103: + curproc = GetCurrentProcess();
104: + vinfo.dwOSVersionInfoSize = sizeof(vinfo);
105: + GetVersionEx(&vinfo);
106: + if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
107: + is_winnt = 1;
108: + else
109: + is_winnt = 0;
110: + }
111: + if ( is_winnt ) {
112: + FILETIME c,e,k,u;
113: +
114: + GetProcessTimes(curproc,&c,&e,&k,&u);
115: + return ((double)k.dwLowDateTime+(double)u.dwLowDateTime
116: + +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0;
117: + } else
118: +// return (double)clock()/(double)CLOCKS_PER_SEC;
119: + return ((double)GetTickCount())/1000.0;
120: +}
121: +
122: +#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32)
123: +
124: +static double get_clock()
125: +{
126: + clock_t c;
127: +
128: + c = clock();
129: + return (double)c/(double)CLOCKS_PER_SEC;
130: +}
131: +
132: +#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__)
133: +
1.4 noro 134: +#include <sys/times.h>
1.2 ohara 135: +#include <limits.h>
136: +
137: +static double get_clock()
138: +{
139: + struct tms buf;
140: +
141: + times(&buf);
142: + return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK;
143: +}
144: +
145: +#else
146: +
147: +#include <sys/time.h>
148: +#include <sys/resource.h>
149: +
150: +static double get_clock()
151: +{
152: + int tv_sec,tv_usec;
153: + struct rusage ru;
154: +
155: + getrusage(RUSAGE_SELF,&ru);
156: + tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
157: + tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
158: + return (double)tv_sec+(double)tv_usec/(double)1000000;
159: +}
160: +#endif
161: +
162: +static double gctime, gcstart;
163: +
164: +void GC_timerstart() {
165: + gcstart = get_clock();
166: +}
167: +
168: +void GC_timerstop() {
169: + gctime += get_clock() - gcstart;
170: +}
171: +
172: +double GC_get_gctime() {
173: + return gctime;
174: +}
175: +
1.11 ohara 176: +
177: STATIC void * GC_CALLBACK GC_default_oom_fn(
178: size_t bytes_requested GC_ATTR_UNUSED)
1.2 ohara 179: {
1.11 ohara 180: diff -urN gc-7.4.2.orig/reclaim.c gc-7.4.2/reclaim.c
181: --- gc-7.4.2.orig/reclaim.c 2014-06-03 15:08:02.000000000 +0900
182: +++ gc-7.4.2/reclaim.c 2015-08-04 14:12:42.000000000 +0900
183: @@ -706,6 +706,7 @@
1.7 ohara 184:
185: if (GC_print_stats == VERBOSE)
186: GET_TIME(start_time);
187: + GC_timerstart();
188: # endif
189:
190: for (kind = 0; kind < GC_n_kinds; kind++) {
1.11 ohara 191: @@ -730,6 +731,7 @@
1.7 ohara 192: }
193: }
194: # ifndef SMALL_CONFIG
195: + GC_timerstop();
196: if (GC_print_stats == VERBOSE) {
197: GET_TIME(done_time);
1.11 ohara 198: GC_verbose_log_printf("Disposing of reclaim lists took %lu msecs\n",
199: diff -urN gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE
200: --- gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900
201: +++ gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900
1.16 ohara 202: @@ -3,7 +3,10 @@
1.14 ohara 203:
204: MY_CPU=AMD64
205: CPU=$(MY_CPU)
206: -!include <ntwin32.mak>
1.16 ohara 207: +cc=cl
208: +cdebug=-Ox -DNDEBUG
209: +cflags=-c -nologo -GS -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -D_WINNT -DLARGE_CONFIG
210: +cvarsmt= -D_MT -MT
1.14 ohara 211:
212: # Make sure that .cc is not viewed as a suffix. It is for VC++2005, but
213: # not earlier versions. We can deal with either, but not inconsistency.
1.11 ohara 214: diff -urN gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_STATIC_THREADS_MAKEFILE
215: --- gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900
216: +++ gc-7.4.2/NT_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900
1.16 ohara 217: @@ -3,7 +3,10 @@
1.14 ohara 218:
219: MY_CPU=X86
220: CPU=$(MY_CPU)
221: -!include <ntwin32.mak>
1.16 ohara 222: +cc=cl
223: +cdebug=-Ox -DNDEBUG
224: +cflags=-c -nologo -GS -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D_X86_=1 -DWIN32 -D_WIN32 -W3 -D_WINNT -DLARGE_CONFIG
225: +cvarsmt= -D_MT -MT
1.14 ohara 226:
227: # Make sure that .cc is not viewed as a suffix. It is for VC++2005, but
228: # not earlier versions. We can deal with either, but not inconsistency.
1.17 ! noro 229: diff -urN gc-7.4.2.orig/include/private/gc_priv.h gc-7.4.2/include/private/gc_priv.h
! 230: --- gc-7.4.2.orig/include/private/gc_priv.h 2014-06-03 15:08:02.000000000 +0900
! 231: +++ gc-7.4.2/include/private/gc_priv.h 2020-11-02 22:27:25.000000000 +0900
! 232: @@ -1840,6 +1840,8 @@
! 233: /* free list nonempty, and return its */
! 234: /* head. Sz is in granules. */
! 235:
! 236: +void GC_timerstart(), GC_timerstop();
! 237: +
! 238: #ifdef GC_ADD_CALLER
! 239: /* GC_DBG_EXTRAS is used by GC debug API functions (unlike GC_EXTRAS */
! 240: /* used by GC debug API macros) thus GC_RETURN_ADDR_PARENT (pointing */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>