Annotation of OpenXM_contrib2/asir2000/gc6.8-risa.diff, Revision 1.1
1.1 ! saito 1: diff -urN gc6.8.orig/alloc.c gc6.8/alloc.c
! 2: --- gc6.8.orig/alloc.c 2005-10-29 09:03:26.000000000 +0900
! 3: +++ gc6.8/alloc.c 2007-08-03 15:05:31.000000000 +0900
! 4: @@ -110,6 +110,7 @@
! 5: GC_bool GC_dont_expand = 0;
! 6:
! 7: word GC_free_space_divisor = 3;
! 8: +word GC_free_space_numerator = 1;
! 9:
! 10: extern GC_bool GC_collection_in_progress();
! 11: /* Collection is in progress, or was abandoned. */
! 12: @@ -174,9 +175,9 @@
! 13: /* use a bit more of large empty heap */
! 14: + total_root_size);
! 15: if (TRUE_INCREMENTAL) {
! 16: - return scan_size / (2 * GC_free_space_divisor);
! 17: + return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor);
! 18: } else {
! 19: - return scan_size / GC_free_space_divisor;
! 20: + return scan_size * GC_free_space_numerator / GC_free_space_divisor;
! 21: }
! 22: }
! 23:
! 24: @@ -492,6 +493,7 @@
! 25: # if defined(REGISTER_LIBRARIES_EARLY)
! 26: GC_cond_register_dynamic_libraries();
! 27: # endif
! 28: + GC_timerstart();
! 29: STOP_WORLD();
! 30: IF_THREADS(GC_world_stopped = TRUE);
! 31: # ifdef CONDPRINT
! 32: @@ -526,6 +528,7 @@
! 33: GC_deficit = i; /* Give the mutator a chance. */
! 34: IF_THREADS(GC_world_stopped = FALSE);
! 35: START_WORLD();
! 36: + GC_timerstop();
! 37: return(FALSE);
! 38: }
! 39: if (GC_mark_some((ptr_t)(&dummy))) break;
! 40: @@ -560,6 +563,7 @@
! 41:
! 42: IF_THREADS(GC_world_stopped = FALSE);
! 43: START_WORLD();
! 44: + GC_timerstop();
! 45: # ifdef PRINTTIMES
! 46: GET_TIME(current_time);
! 47: GC_printf1("World-stopped marking took %lu msecs\n",
! 48: @@ -640,6 +644,7 @@
! 49: GET_TIME(start_time);
! 50: finalize_time = start_time;
! 51: # endif
! 52: + GC_timerstart();
! 53:
! 54: # ifdef GATHERSTATS
! 55: GC_mem_found = 0;
! 56: @@ -757,6 +762,7 @@
! 57: MS_TIME_DIFF(finalize_time,start_time),
! 58: MS_TIME_DIFF(done_time,finalize_time));
! 59: # endif
! 60: + GC_timerstop();
! 61: }
! 62:
! 63: /* Externally callable routine to invoke full, stop-world collection */
! 64: @@ -971,6 +977,9 @@
! 65: if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
! 66: GC_collect_at_heapsize = (word)(-1);
! 67: # endif
! 68: +#if defined(VISUAL_LIB)
! 69: + SendHeapSize();
! 70: +#endif
! 71: return(TRUE);
! 72: }
! 73:
! 74: @@ -1067,6 +1076,22 @@
! 75:
! 76: if (sz == 0) return(0);
! 77:
! 78: +#if defined(VISUAL)
! 79: + {
! 80: +#include <signal.h>
! 81: + extern int recv_intr;
! 82: + if ( recv_intr ) {
! 83: + if ( recv_intr == 1 ) {
! 84: + recv_intr = 0;
! 85: + int_handler();
! 86: + } else {
! 87: + recv_intr = 0;
! 88: + ox_usr1_handler(0);
! 89: + }
! 90: + }
! 91: + }
! 92: +#endif
! 93: +
! 94: while (*flh == 0) {
! 95: ENTER_GC();
! 96: /* Do our share of marking work */
! 97: diff -urN gc6.8.orig/configure gc6.8/configure
! 98: --- gc6.8.orig/configure 2006-03-24 09:42:55.000000000 +0900
! 99: +++ gc6.8/configure 2007-08-03 15:05:31.000000000 +0900
! 100: @@ -9628,7 +9628,7 @@
! 101: _ACEOF
! 102:
! 103: cat >>confdefs.h <<\_ACEOF
! 104: -#define NO_SIGNALS 1
! 105: +##define NO_SIGNALS 1
! 106: _ACEOF
! 107:
! 108: cat >>confdefs.h <<\_ACEOF
! 109: diff -urN gc6.8.orig/dbg_mlc.c gc6.8/dbg_mlc.c
! 110: --- gc6.8.orig/dbg_mlc.c 2006-02-18 10:38:53.000000000 +0900
! 111: +++ gc6.8/dbg_mlc.c 2007-08-03 15:05:31.000000000 +0900
! 112: @@ -477,6 +477,23 @@
! 113: GC_register_displacement((word)sizeof(oh) + offset);
! 114: }
! 115:
! 116: +#if defined(__FreeBSD__)
! 117: +#include <dlfcn.h>
! 118: +static void GC_caller_func_offset(ad, symp, offp)
! 119: +const GC_word ad;
! 120: +const char **symp;
! 121: +int *offp;
! 122: +{
! 123: + Dl_info caller;
! 124: + if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) {
! 125: + *symp = caller.dli_sname;
! 126: + *offp = (const char *)ad - (const char *)caller.dli_saddr;
! 127: + }
! 128: +}
! 129: +#else
! 130: +#define GC_caller_func(ad, symp, offp)
! 131: +#endif
! 132: +
! 133: # ifdef __STDC__
! 134: GC_PTR GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS)
! 135: # else
! 136: @@ -491,6 +508,13 @@
! 137: {
! 138: GC_PTR result = GC_malloc(lb + DEBUG_BYTES);
! 139:
! 140: +#ifdef GC_ADD_CALLER
! 141: + if (s == NULL) {
! 142: + GC_caller_func_offset(ra, &s, &i);
! 143: + if (s == NULL)
! 144: + s = "unknown";
! 145: + }
! 146: +#endif
! 147: if (result == 0) {
! 148: GC_err_printf1("GC_debug_malloc(%ld) returning NIL (",
! 149: (unsigned long) lb);
! 150: @@ -880,6 +904,13 @@
! 151: register size_t old_sz;
! 152: register hdr * hhdr;
! 153:
! 154: +#ifdef GC_ADD_CALLER
! 155: + if (s == NULL) {
! 156: + GC_caller_func_offset(ra, &s, &i);
! 157: + if (s == NULL)
! 158: + s = "unknown";
! 159: + }
! 160: +#endif
! 161: if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i));
! 162: if (base == 0) {
! 163: GC_err_printf1(
! 164: @@ -1188,7 +1219,11 @@
! 165: }
! 166:
! 167: #ifdef GC_ADD_CALLER
! 168: -# define RA GC_RETURN_ADDR,
! 169: +# ifdef GC_RETURN_ADDR_PARENT
! 170: +# define RA GC_RETURN_ADDR_PARENT,
! 171: +# else
! 172: +# define RA GC_RETURN_ADDR,
! 173: +# endif
! 174: #else
! 175: # define RA
! 176: #endif
! 177: @@ -1196,12 +1231,12 @@
! 178: GC_PTR GC_debug_malloc_replacement(lb)
! 179: size_t lb;
! 180: {
! 181: - return GC_debug_malloc(lb, RA "unknown", 0);
! 182: + return GC_debug_malloc(lb, RA NULL, 0);
! 183: }
! 184:
! 185: GC_PTR GC_debug_realloc_replacement(p, lb)
! 186: GC_PTR p;
! 187: size_t lb;
! 188: {
! 189: - return GC_debug_realloc(p, lb, RA "unknown", 0);
! 190: + return GC_debug_realloc(p, lb, RA NULL, 0);
! 191: }
! 192: diff -urN gc6.8.orig/dyn_load.c gc6.8/dyn_load.c
! 193: --- gc6.8.orig/dyn_load.c 2006-06-07 14:01:52.000000000 +0900
! 194: +++ gc6.8/dyn_load.c 2007-08-03 15:05:31.000000000 +0900
! 195: @@ -102,6 +102,12 @@
! 196: # else
! 197: # define ElfW(type) Elf64_##type
! 198: # endif
! 199: +# elif defined(__FreeBSD__)
! 200: +# if __ELF_WORD_SIZE == 32
! 201: +# define ElfW(type) Elf32_##type
! 202: +# else
! 203: +# define ElfW(type) Elf64_##type
! 204: +# endif
! 205: # else
! 206: # ifdef NETBSD
! 207: # if ELFSIZE == 32
! 208: diff -urN gc6.8.orig/include/gc.h gc6.8/include/gc.h
! 209: --- gc6.8.orig/include/gc.h 2006-07-08 09:10:16.000000000 +0900
! 210: +++ gc6.8/include/gc.h 2007-08-03 15:05:31.000000000 +0900
! 211: @@ -504,6 +504,7 @@
! 212: /* gcc knows how to retrieve return address, but we don't know */
! 213: /* how to generate call stacks. */
! 214: # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
! 215: +# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1)
! 216: # else
! 217: /* Just pass 0 for gcc compatibility. */
! 218: # define GC_RETURN_ADDR 0
! 219: diff -urN gc6.8.orig/include/private/gc_priv.h gc6.8/include/private/gc_priv.h
! 220: --- gc6.8.orig/include/private/gc_priv.h 2006-02-11 04:38:40.000000000 +0900
! 221: +++ gc6.8/include/private/gc_priv.h 2007-08-03 15:05:31.000000000 +0900
! 222: @@ -227,6 +227,10 @@
! 223: # define EXTRA_BYTES 0
! 224: #endif
! 225:
! 226: +/* Added by ohara */
! 227: +# ifndef LARGE_CONFIG
! 228: +# define LARGE_CONFIG
! 229: +# endif
! 230:
! 231: # ifndef LARGE_CONFIG
! 232: # define MINHINCR 16 /* Minimum heap increment, in blocks of HBLKSIZE */
! 233: diff -urN gc6.8.orig/include/private/gcconfig.h gc6.8/include/private/gcconfig.h
! 234: --- gc6.8.orig/include/private/gcconfig.h 2006-07-08 06:08:05.000000000 +0900
! 235: +++ gc6.8/include/private/gcconfig.h 2007-08-03 15:05:31.000000000 +0900
! 236: @@ -63,7 +63,7 @@
! 237: /* Determine the machine type: */
! 238: # if defined(__arm__) || defined(__thumb__)
! 239: # define ARM32
! 240: -# if !defined(LINUX) && !defined(NETBSD)
! 241: +# if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
! 242: # define NOSYS
! 243: # define mach_type_known
! 244: # endif
! 245: @@ -342,10 +342,22 @@
! 246: # define X86_64
! 247: # define mach_type_known
! 248: # endif
! 249: +# if defined(__FreeBSD__) && defined(__amd64__)
! 250: +# define X86_64
! 251: +# define mach_type_known
! 252: +# endif
! 253: # if defined(FREEBSD) && defined(__sparc__)
! 254: # define SPARC
! 255: # define mach_type_known
! 256: -#endif
! 257: +# endif
! 258: +# if defined(FREEBSD) && defined(__powerpc__)
! 259: +# define POWERPC
! 260: +# define mach_type_known
! 261: +# endif
! 262: +# if defined(FREEBSD) && defined(__arm__)
! 263: +# define ARM32
! 264: +# define mach_type_known
! 265: +# endif
! 266: # if defined(bsdi) && (defined(i386) || defined(__i386__))
! 267: # define I386
! 268: # define BSDI
! 269: @@ -860,6 +872,16 @@
! 270: # define DATASTART GC_data_start
! 271: # define DYNAMIC_LOADING
! 272: # endif
! 273: +# ifdef FREEBSD
! 274: +# define ALIGNMENT 4
! 275: +# define OS_TYPE "FREEBSD"
! 276: +# ifdef __ELF__
! 277: +# define DYNAMIC_LOADING
! 278: +# endif
! 279: +# define HEURISTIC2
! 280: + extern char etext[];
! 281: +# define SEARCH_FOR_DATA_START
! 282: +# endif
! 283: # ifdef NOSYS
! 284: # define ALIGNMENT 4
! 285: # define OS_TYPE "NOSYS"
! 286: @@ -1862,6 +1884,17 @@
! 287: # endif
! 288: # define USE_GENERIC_PUSH_REGS
! 289: # endif
! 290: +# ifdef FREEBSD
! 291: +# define ALIGNMENT 4
! 292: +# define OS_TYPE "FREEBSD"
! 293: +# ifdef __ELF__
! 294: +# define DYNAMIC_LOADING
! 295: +# endif
! 296: +# define HEURISTIC2
! 297: + extern char etext[];
! 298: +# define SEARCH_FOR_DATA_START
! 299: +# endif
! 300: +
! 301: # ifdef LINUX
! 302: # define OS_TYPE "LINUX"
! 303: # define LINUX_STACKBOTTOM
! 304: @@ -2026,9 +2059,20 @@
! 305: # define DYNAMIC_LOADING
! 306: # endif
! 307: extern char etext[];
! 308: + extern int _etext[];
! 309: + extern char edata[];
! 310: + extern char end[];
! 311: extern char * GC_FreeBSDGetDataStart();
! 312: +# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
! 313: +/* T.Saito
! 314: # define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
! 315: -# endif
! 316: +# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
! 317: +*/
! 318: +# define NEED_FIND_LIMIT
! 319: +# define DATAEND (GC_find_limit (DATASTART, TRUE))
! 320: +# define DATASTART2 ((ptr_t)(&edata))
! 321: +# define DATAEND2 ((ptr_t)(&end))
! 322: +# endif /* end T.Saito */
! 323: # ifdef NETBSD
! 324: # define OS_TYPE "NETBSD"
! 325: # ifdef __ELF__
! 326: @@ -2038,6 +2082,17 @@
! 327: extern char etext[];
! 328: # define SEARCH_FOR_DATA_START
! 329: # endif
! 330: +# ifdef FREEBSD
! 331: +# define OS_TYPE "FREEBSD"
! 332: +# define SIG_SUSPEND SIGUSR1
! 333: +# define SIG_THR_RESTART SIGUSR2
! 334: +# ifdef __ELF__
! 335: +# define DYNAMIC_LOADING
! 336: +# endif
! 337: +# define HEURISTIC2
! 338: + extern char etext[];
! 339: +# define SEARCH_FOR_DATA_START
! 340: +# endif
! 341: # ifdef SOLARIS
! 342: # define OS_TYPE "SOLARIS"
! 343: # define ELF_CLASS ELFCLASS64
! 344: diff -urN gc6.8.orig/os_dep.c gc6.8/os_dep.c
! 345: --- gc6.8.orig/os_dep.c 2006-04-22 08:26:47.000000000 +0900
! 346: +++ gc6.8/os_dep.c 2007-08-03 15:05:31.000000000 +0900
! 347: @@ -694,7 +694,7 @@
! 348: || defined(HURD) || defined(NETBSD)
! 349: static struct sigaction old_segv_act;
! 350: # if defined(IRIX5) || defined(HPUX) \
! 351: - || defined(HURD) || defined(NETBSD)
! 352: + || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
! 353: static struct sigaction old_bus_act;
! 354: # endif
! 355: # else
! 356: @@ -709,7 +709,7 @@
! 357: # endif
! 358: {
! 359: # if defined(SUNOS5SIGS) || defined(IRIX5) \
! 360: - || defined(OSF1) || defined(HURD) || defined(NETBSD)
! 361: + || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
! 362: struct sigaction act;
! 363:
! 364: act.sa_handler = h;
! 365: @@ -731,7 +731,7 @@
! 366: # else
! 367: (void) sigaction(SIGSEGV, &act, &old_segv_act);
! 368: # if defined(IRIX5) \
! 369: - || defined(HPUX) || defined(HURD) || defined(NETBSD)
! 370: + || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
! 371: /* Under Irix 5.x or HP/UX, we may get SIGBUS. */
! 372: /* Pthreads doesn't exist under Irix 5.x, so we */
! 373: /* don't have to worry in the threads case. */
! 374: diff -urN gc6.8.orig/reclaim.c gc6.8/reclaim.c
! 375: --- gc6.8.orig/reclaim.c 2004-11-23 02:58:18.000000000 +0900
! 376: +++ gc6.8/reclaim.c 2007-08-03 15:05:31.000000000 +0900
! 377: @@ -1030,6 +1030,7 @@
! 378:
! 379: GET_TIME(start_time);
! 380: # endif
! 381: + GC_timerstart();
! 382:
! 383: for (kind = 0; kind < GC_n_kinds; kind++) {
! 384: ok = &(GC_obj_kinds[kind]);
! 385: @@ -1052,6 +1053,7 @@
! 386: }
! 387: }
! 388: }
! 389: + GC_timerstop();
! 390: # ifdef PRINTTIMES
! 391: GET_TIME(done_time);
! 392: GC_printf1("Disposing of reclaim lists took %lu msecs\n",
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>