Annotation of OpenXM_contrib2/asir2000/gc-7.0-risa.diff, Revision 1.4
1.4 ! noro 1: %% $OpenXM: OpenXM_contrib2/asir2000/gc-7.0-risa.diff,v 1.3 2009/03/10 16:36:15 ohara Exp $
1.1 ohara 2: %% This patch is based on gc6.5-risa.diff.
3: diff -urN gc-7.0.orig/alloc.c gc-7.0/alloc.c
4: --- gc-7.0.orig/alloc.c 2007-06-22 11:40:30.000000000 +0900
5: +++ gc-7.0/alloc.c 2007-11-09 17:29:38.000000000 +0900
6: @@ -100,6 +100,7 @@
7: GC_bool GC_dont_expand = 0;
8:
9: word GC_free_space_divisor = 3;
10: +word GC_free_space_numerator = 1;
11:
12: extern GC_bool GC_collection_in_progress();
13: /* Collection is in progress, or was abandoned. */
14: @@ -160,9 +161,9 @@
15: scan_size = 2 * GC_composite_in_use + GC_atomic_in_use
16: + total_root_size;
17: if (TRUE_INCREMENTAL) {
18: - return scan_size / (2 * GC_free_space_divisor);
19: + return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor);
20: } else {
21: - return scan_size / GC_free_space_divisor;
22: + return scan_size * GC_free_space_numerator / GC_free_space_divisor;
23: }
24: }
25:
26: @@ -451,6 +452,7 @@
27: # if defined(REGISTER_LIBRARIES_EARLY)
28: GC_cond_register_dynamic_libraries();
29: # endif
30: + GC_timerstart();
31: STOP_WORLD();
32: IF_THREADS(GC_world_stopped = TRUE);
33: if (GC_print_stats) {
34: @@ -479,6 +481,7 @@
35: GC_deficit = i; /* Give the mutator a chance. */
36: IF_THREADS(GC_world_stopped = FALSE);
37: START_WORLD();
38: + GC_timerstop();
39: return(FALSE);
40: }
41: if (GC_mark_some((ptr_t)(&dummy))) break;
42: @@ -503,6 +506,7 @@
43:
44: IF_THREADS(GC_world_stopped = FALSE);
45: START_WORLD();
46: + GC_timerstop();
47: if (GC_print_stats) {
48: GET_TIME(current_time);
49: GC_log_printf("World-stopped marking took %lu msecs\n",
50: @@ -603,6 +607,7 @@
51: /* FIXME: Add more checks. */
52: GC_check_tls();
53: # endif
54: + GC_timerstart();
55:
56: if (GC_print_stats)
57: GET_TIME(start_time);
58: @@ -722,6 +727,7 @@
59: MS_TIME_DIFF(finalize_time,start_time),
60: MS_TIME_DIFF(done_time,finalize_time));
61: }
62: + GC_timerstop();
63: }
64:
65: /* Externally callable routine to invoke full, stop-world collection */
66: @@ -908,6 +914,9 @@
67: if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
68: GC_collect_at_heapsize = (word)(-1);
69: # endif
1.3 ohara 70: +#if defined(VISUAL)
1.1 ohara 71: + SendHeapSize();
72: +#endif
73: return(TRUE);
74: }
75:
76: @@ -991,6 +1000,22 @@
77:
78: if (gran == 0) return(0);
79:
1.2 ohara 80: +#if defined(_MSC_VER)
1.1 ohara 81: + {
82: +#include <signal.h>
83: + extern int recv_intr;
84: + if ( recv_intr ) {
85: + if ( recv_intr == 1 ) {
86: + recv_intr = 0;
87: + int_handler();
88: + } else {
89: + recv_intr = 0;
90: + ox_usr1_handler(0);
91: + }
92: + }
93: + }
94: +#endif
95: +
96: while (*flh == 0) {
97: ENTER_GC();
98: /* Do our share of marking work */
99: diff -urN gc-7.0.orig/reclaim.c gc-7.0/reclaim.c
100: --- gc-7.0.orig/reclaim.c 2007-06-07 09:24:17.000000000 +0900
101: +++ gc-7.0/reclaim.c 2007-11-09 17:32:31.000000000 +0900
102: @@ -577,7 +577,7 @@
103:
104: if (GC_print_stats == VERBOSE)
105: GET_TIME(start_time);
106: -
107: + GC_timerstart();
108: for (kind = 0; kind < GC_n_kinds; kind++) {
109: ok = &(GC_obj_kinds[kind]);
110: rlp = ok -> ok_reclaim_list;
111: @@ -599,6 +599,7 @@
112: }
113: }
114: }
115: + GC_timerstop();
116: if (GC_print_stats == VERBOSE) {
117: GET_TIME(done_time);
118: GC_log_printf("Disposing of reclaim lists took %lu msecs\n",
1.2 ohara 119: diff -urN gc-7.1.orig/misc.c gc-7.1/misc.c
120: --- gc-7.1.orig/misc.c 2008-02-21 07:20:52.000000000 +0900
121: +++ gc-7.1/misc.c 2009-03-04 14:01:58.000000000 +0900
122: @@ -122,6 +122,93 @@
123: long GC_large_alloc_warn_suppressed = 0;
124: /* Number of warnings suppressed so far. */
125:
126: +#include <time.h>
127: +
128: +#if defined(_MSC_VER)
129: +#include <windows.h>
130: +
131: +static double get_clock()
132: +{
133: + static int initialized = 0;
134: + static int is_winnt = 0;
135: + static HANDLE curproc;
136: +
137: + if ( !initialized ) {
138: + OSVERSIONINFO vinfo;
139: +
140: + curproc = GetCurrentProcess();
141: + vinfo.dwOSVersionInfoSize = sizeof(vinfo);
142: + GetVersionEx(&vinfo);
143: + if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
144: + is_winnt = 1;
145: + else
146: + is_winnt = 0;
147: + }
148: + if ( is_winnt ) {
149: + FILETIME c,e,k,u;
150: +
151: + GetProcessTimes(curproc,&c,&e,&k,&u);
152: + return ((double)k.dwLowDateTime+(double)u.dwLowDateTime
153: + +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0;
154: + } else
155: +// return (double)clock()/(double)CLOCKS_PER_SEC;
156: + return ((double)GetTickCount())/1000.0;
157: +}
158: +
159: +#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32)
160: +
161: +static double get_clock()
162: +{
163: + clock_t c;
164: +
165: + c = clock();
166: + return (double)c/(double)CLOCKS_PER_SEC;
167: +}
168: +
169: +#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__)
170: +
1.4 ! noro 171: +#include <sys/times.h>
1.2 ohara 172: +#include <limits.h>
173: +
174: +static double get_clock()
175: +{
176: + struct tms buf;
177: +
178: + times(&buf);
179: + return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK;
180: +}
181: +
182: +#else
183: +
184: +#include <sys/time.h>
185: +#include <sys/resource.h>
186: +
187: +static double get_clock()
188: +{
189: + int tv_sec,tv_usec;
190: + struct rusage ru;
191: +
192: + getrusage(RUSAGE_SELF,&ru);
193: + tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
194: + tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
195: + return (double)tv_sec+(double)tv_usec/(double)1000000;
196: +}
197: +#endif
198: +
199: +static double gctime, gcstart;
200: +
201: +void GC_timerstart() {
202: + gcstart = get_clock();
203: +}
204: +
205: +void GC_timerstop() {
206: + gctime += get_clock() - gcstart;
207: +}
208: +
209: +double GC_get_gctime() {
210: + return gctime;
211: +}
212: +
213: /*ARGSUSED*/
214: void * GC_default_oom_fn(size_t bytes_requested)
215: {
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>