| version 1.4, 2009/04/07 06:47:42 |
version 1.17, 2020/11/02 14:13:42 |
|
|
| %% $OpenXM: OpenXM_contrib2/asir2000/gc-7.0-risa.diff,v 1.3 2009/03/10 16:36:15 ohara Exp $ |
diff -urN gc-7.4.2.orig/alloc.c gc-7.4.2/alloc.c |
| %% This patch is based on gc6.5-risa.diff. |
--- gc-7.4.2.orig/alloc.c 2014-06-03 15:08:01.000000000 +0900 |
| diff -urN gc-7.0.orig/alloc.c gc-7.0/alloc.c |
+++ gc-7.4.2/alloc.c 2015-08-25 16:00:00.000000000 +0900 |
| --- gc-7.0.orig/alloc.c 2007-06-22 11:40:30.000000000 +0900 |
@@ -121,6 +121,7 @@ |
| +++ gc-7.0/alloc.c 2007-11-09 17:29:38.000000000 +0900 |
#endif |
| @@ -100,6 +100,7 @@ |
|
| GC_bool GC_dont_expand = 0; |
|
| |
|
| word GC_free_space_divisor = 3; |
word GC_free_space_divisor = GC_FREE_SPACE_DIVISOR; |
| +word GC_free_space_numerator = 1; |
+word GC_free_space_numerator = 1; |
| |
|
| extern GC_bool GC_collection_in_progress(); |
GC_INNER int GC_CALLBACK GC_never_stop_func(void) |
| /* Collection is in progress, or was abandoned. */ |
{ |
| @@ -160,9 +161,9 @@ |
@@ -227,8 +228,8 @@ |
| scan_size = 2 * GC_composite_in_use + GC_atomic_in_use |
total_root_size = 2 * stack_size + GC_root_size; |
| + total_root_size; |
scan_size = 2 * GC_composite_in_use + GC_atomic_in_use / 4 |
| if (TRUE_INCREMENTAL) { |
+ total_root_size; |
| - return scan_size / (2 * GC_free_space_divisor); |
- result = scan_size / GC_free_space_divisor; |
| + return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor); |
- if (GC_incremental) { |
| } else { |
+ result = scan_size * GC_free_space_numerator / GC_free_space_divisor; |
| - return scan_size / GC_free_space_divisor; |
+ if (1 || GC_incremental) { |
| + return scan_size * GC_free_space_numerator / GC_free_space_divisor; |
result /= 2; |
| } |
} |
| } |
return result > 0 ? result : 1; |
| |
@@ -603,6 +604,7 @@ |
| @@ -451,6 +452,7 @@ |
GET_TIME(start_time); |
| # if defined(REGISTER_LIBRARIES_EARLY) |
|
| GC_cond_register_dynamic_libraries(); |
|
| # endif |
# endif |
| |
|
| + GC_timerstart(); |
+ GC_timerstart(); |
| STOP_WORLD(); |
STOP_WORLD(); |
| IF_THREADS(GC_world_stopped = TRUE); |
# ifdef THREAD_LOCAL_ALLOC |
| if (GC_print_stats) { |
GC_world_stopped = TRUE; |
| @@ -479,6 +481,7 @@ |
@@ -632,6 +634,7 @@ |
| GC_deficit = i; /* Give the mutator a chance. */ |
GC_world_stopped = FALSE; |
| IF_THREADS(GC_world_stopped = FALSE); |
# endif |
| START_WORLD(); |
START_WORLD(); |
| + GC_timerstop(); |
+ GC_timerstop(); |
| return(FALSE); |
return(FALSE); |
| } |
} |
| if (GC_mark_some((ptr_t)(&dummy))) break; |
if (GC_mark_some(GC_approx_sp())) break; |
| @@ -503,6 +506,7 @@ |
@@ -653,6 +656,7 @@ |
| |
GC_world_stopped = FALSE; |
| IF_THREADS(GC_world_stopped = FALSE); |
# endif |
| START_WORLD(); |
START_WORLD(); |
| + GC_timerstop(); |
+ GC_timerstop(); |
| if (GC_print_stats) { |
# ifndef SMALL_CONFIG |
| GET_TIME(current_time); |
if (GC_PRINT_STATS_FLAG) { |
| GC_log_printf("World-stopped marking took %lu msecs\n", |
unsigned long time_diff; |
| @@ -603,6 +607,7 @@ |
@@ -836,6 +840,7 @@ |
| /* FIXME: Add more checks. */ |
/* FIXME: Add more checks. */ |
| GC_check_tls(); |
GC_check_tls(); |
| # endif |
# endif |
| + GC_timerstart(); |
+ GC_timerstart(); |
| |
|
| if (GC_print_stats) |
# ifndef SMALL_CONFIG |
| GET_TIME(start_time); |
if (GC_print_stats) |
| @@ -722,6 +727,7 @@ |
@@ -958,6 +963,7 @@ |
| MS_TIME_DIFF(finalize_time,start_time), |
MS_TIME_DIFF(done_time,finalize_time)); |
| MS_TIME_DIFF(done_time,finalize_time)); |
} |
| } |
# endif |
| + GC_timerstop(); |
+ GC_timerstop(); |
| } |
} |
| |
|
| /* Externally callable routine to invoke full, stop-world collection */ |
/* If stop_func == 0 then GC_default_stop_func is used instead. */ |
| @@ -908,6 +914,9 @@ |
@@ -1215,6 +1221,9 @@ |
| if (GC_collect_at_heapsize < GC_heapsize /* wrapped */) |
if (GC_on_heap_resize) |
| GC_collect_at_heapsize = (word)(-1); |
(*GC_on_heap_resize)(GC_heapsize); |
| # endif |
|
| +#if defined(VISUAL) |
+#if defined(VISUAL) |
| + SendHeapSize(); |
+ SendHeapSize(); |
| +#endif |
+#endif |
| return(TRUE); |
return(TRUE); |
| } |
} |
| |
|
| @@ -991,6 +1000,22 @@ |
@@ -1276,7 +1285,7 @@ |
| |
} |
| if (gran == 0) return(0); |
|
| |
|
| +#if defined(_MSC_VER) |
|
| + { |
|
| +#include <signal.h> |
|
| + extern int recv_intr; |
|
| + if ( recv_intr ) { |
|
| + if ( recv_intr == 1 ) { |
|
| + recv_intr = 0; |
|
| + int_handler(); |
|
| + } else { |
|
| + recv_intr = 0; |
|
| + ox_usr1_handler(0); |
|
| + } |
|
| + } |
|
| + } |
|
| +#endif |
|
| + |
|
| while (*flh == 0) { |
|
| ENTER_GC(); |
|
| /* Do our share of marking work */ |
|
| diff -urN gc-7.0.orig/reclaim.c gc-7.0/reclaim.c |
|
| --- gc-7.0.orig/reclaim.c 2007-06-07 09:24:17.000000000 +0900 |
|
| +++ gc-7.0/reclaim.c 2007-11-09 17:32:31.000000000 +0900 |
|
| @@ -577,7 +577,7 @@ |
|
| |
|
| if (GC_print_stats == VERBOSE) |
|
| GET_TIME(start_time); |
|
| - |
|
| + GC_timerstart(); |
|
| for (kind = 0; kind < GC_n_kinds; kind++) { |
|
| ok = &(GC_obj_kinds[kind]); |
|
| rlp = ok -> ok_reclaim_list; |
|
| @@ -599,6 +599,7 @@ |
|
| } |
|
| } |
|
| } |
} |
| + GC_timerstop(); |
|
| if (GC_print_stats == VERBOSE) { |
|
| GET_TIME(done_time); |
|
| GC_log_printf("Disposing of reclaim lists took %lu msecs\n", |
|
| diff -urN gc-7.1.orig/misc.c gc-7.1/misc.c |
|
| --- gc-7.1.orig/misc.c 2008-02-21 07:20:52.000000000 +0900 |
|
| +++ gc-7.1/misc.c 2009-03-04 14:01:58.000000000 +0900 |
|
| @@ -122,6 +122,93 @@ |
|
| long GC_large_alloc_warn_suppressed = 0; |
|
| /* Number of warnings suppressed so far. */ |
|
| |
|
| |
- blocks_to_get = GC_heapsize/(HBLKSIZE*GC_free_space_divisor) |
| |
+ blocks_to_get = GC_heapsize * GC_free_space_numerator /(HBLKSIZE*GC_free_space_divisor) |
| |
+ needed_blocks; |
| |
if (blocks_to_get > MAXHINCR) { |
| |
word slop; |
| |
diff -urN gc-7.4.2.orig/misc.c gc-7.4.2/misc.c |
| |
--- gc-7.4.2.orig/misc.c 2014-06-03 15:08:02.000000000 +0900 |
| |
+++ gc-7.4.2/misc.c 2015-08-04 14:21:02.000000000 +0900 |
| |
@@ -161,6 +161,94 @@ |
| |
GC_INNER long GC_large_alloc_warn_interval = GC_LARGE_ALLOC_WARN_INTERVAL; |
| |
/* Interval between unsuppressed warnings. */ |
| |
|
| +#include <time.h> |
+#include <time.h> |
| + |
+ |
| +#if defined(_MSC_VER) |
+#if defined(_MSC_VER) |
| Line 210 diff -urN gc-7.1.orig/misc.c gc-7.1/misc.c |
|
| Line 173 diff -urN gc-7.1.orig/misc.c gc-7.1/misc.c |
|
| + return gctime; |
+ return gctime; |
| +} |
+} |
| + |
+ |
| /*ARGSUSED*/ |
+ |
| void * GC_default_oom_fn(size_t bytes_requested) |
STATIC void * GC_CALLBACK GC_default_oom_fn( |
| |
size_t bytes_requested GC_ATTR_UNUSED) |
| { |
{ |
| |
diff -urN gc-7.4.2.orig/reclaim.c gc-7.4.2/reclaim.c |
| |
--- gc-7.4.2.orig/reclaim.c 2014-06-03 15:08:02.000000000 +0900 |
| |
+++ gc-7.4.2/reclaim.c 2015-08-04 14:12:42.000000000 +0900 |
| |
@@ -706,6 +706,7 @@ |
| |
|
| |
if (GC_print_stats == VERBOSE) |
| |
GET_TIME(start_time); |
| |
+ GC_timerstart(); |
| |
# endif |
| |
|
| |
for (kind = 0; kind < GC_n_kinds; kind++) { |
| |
@@ -730,6 +731,7 @@ |
| |
} |
| |
} |
| |
# ifndef SMALL_CONFIG |
| |
+ GC_timerstop(); |
| |
if (GC_print_stats == VERBOSE) { |
| |
GET_TIME(done_time); |
| |
GC_verbose_log_printf("Disposing of reclaim lists took %lu msecs\n", |
| |
diff -urN gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE |
| |
--- gc-7.4.2.orig/NT_X64_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900 |
| |
+++ gc-7.4.2/NT_X64_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900 |
| |
@@ -3,7 +3,10 @@ |
| |
|
| |
MY_CPU=AMD64 |
| |
CPU=$(MY_CPU) |
| |
-!include <ntwin32.mak> |
| |
+cc=cl |
| |
+cdebug=-Ox -DNDEBUG |
| |
+cflags=-c -nologo -GS -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -D_WINNT -DLARGE_CONFIG |
| |
+cvarsmt= -D_MT -MT |
| |
|
| |
# Make sure that .cc is not viewed as a suffix. It is for VC++2005, but |
| |
# not earlier versions. We can deal with either, but not inconsistency. |
| |
diff -urN gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE gc-7.4.2/NT_STATIC_THREADS_MAKEFILE |
| |
--- gc-7.4.2.orig/NT_STATIC_THREADS_MAKEFILE 2014-06-03 15:08:01.000000000 +0900 |
| |
+++ gc-7.4.2/NT_STATIC_THREADS_MAKEFILE 2015-08-04 14:12:42.000000000 +0900 |
| |
@@ -3,7 +3,10 @@ |
| |
|
| |
MY_CPU=X86 |
| |
CPU=$(MY_CPU) |
| |
-!include <ntwin32.mak> |
| |
+cc=cl |
| |
+cdebug=-Ox -DNDEBUG |
| |
+cflags=-c -nologo -GS -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D_X86_=1 -DWIN32 -D_WIN32 -W3 -D_WINNT -DLARGE_CONFIG |
| |
+cvarsmt= -D_MT -MT |
| |
|
| |
# Make sure that .cc is not viewed as a suffix. It is for VC++2005, but |
| |
# not earlier versions. We can deal with either, but not inconsistency. |
| |
diff -urN gc-7.4.2.orig/include/private/gc_priv.h gc-7.4.2/include/private/gc_priv.h |
| |
--- gc-7.4.2.orig/include/private/gc_priv.h 2014-06-03 15:08:02.000000000 +0900 |
| |
+++ gc-7.4.2/include/private/gc_priv.h 2020-11-02 22:27:25.000000000 +0900 |
| |
@@ -1840,6 +1840,8 @@ |
| |
/* free list nonempty, and return its */ |
| |
/* head. Sz is in granules. */ |
| |
|
| |
+void GC_timerstart(), GC_timerstop(); |
| |
+ |
| |
#ifdef GC_ADD_CALLER |
| |
/* GC_DBG_EXTRAS is used by GC debug API functions (unlike GC_EXTRAS */ |
| |
/* used by GC debug API macros) thus GC_RETURN_ADDR_PARENT (pointing */ |