[BACK]Return to gc-7.0-risa.diff CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000

Annotation of OpenXM_contrib2/asir2000/gc-7.0-risa.diff, Revision 1.5

1.5     ! noro        1: diff -urN gc-7.2alpha4.org/alloc.c gc-7.2alpha4/alloc.c
        !             2: --- gc-7.2alpha4.org/alloc.c   2010-01-04 16:54:50.892052700 -0500
        !             3: +++ gc-7.2alpha4/alloc.c       2010-01-04 17:03:29.952052700 -0500
        !             4: @@ -117,6 +117,7 @@
        !             5:  #endif
1.1       ohara       6:
1.5     ! noro        7:  word GC_free_space_divisor = GC_FREE_SPACE_DIVISOR;
1.1       ohara       8: +word GC_free_space_numerator = 1;
                      9:
1.5     ! noro       10:  GC_INNER int GC_CALLBACK GC_never_stop_func(void)
        !            11:  {
        !            12: @@ -222,9 +223,9 @@
        !            13:      scan_size = 2 * GC_composite_in_use + GC_atomic_in_use / 4
1.1       ohara      14:                + total_root_size;
1.5     ! noro       15:      if (GC_incremental) {
1.1       ohara      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;
1.5     ! noro       20: +        return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor);
1.1       ohara      21:      }
                     22:  }
                     23:
1.5     ! noro       24: @@ -581,6 +582,7 @@
        !            25:          GET_TIME(start_time);
1.1       ohara      26:  #   endif
1.5     ! noro       27:
1.1       ohara      28: +      GC_timerstart();
                     29:      STOP_WORLD();
1.5     ! noro       30:  #   ifdef THREAD_LOCAL_ALLOC
        !            31:        GC_world_stopped = TRUE;
        !            32: @@ -613,6 +615,7 @@
        !            33:                        GC_world_stopped = FALSE;
        !            34:  #                   endif
1.1       ohara      35:                    START_WORLD();
                     36: +                              GC_timerstop();
                     37:                    return(FALSE);
                     38:            }
                     39:            if (GC_mark_some((ptr_t)(&dummy))) break;
1.5     ! noro       40: @@ -635,6 +638,7 @@
        !            41:        GC_world_stopped = FALSE;
        !            42:  #   endif
1.1       ohara      43:      START_WORLD();
                     44: +    GC_timerstop();
1.5     ! noro       45:  #   ifndef SMALL_CONFIG
1.1       ohara      46:      if (GC_print_stats) {
1.5     ! noro       47:          unsigned long time_diff;
        !            48: @@ -784,6 +788,7 @@
1.1       ohara      49:          /* FIXME: Add more checks.                            */
                     50:          GC_check_tls();
                     51:  #   endif
                     52: +      GC_timerstart();
                     53:
1.5     ! noro       54:  #   ifndef SMALL_CONFIG
1.1       ohara      55:      if (GC_print_stats)
1.5     ! noro       56: @@ -917,6 +922,7 @@
1.1       ohara      57:                      MS_TIME_DIFF(done_time,finalize_time));
                     58:      }
1.5     ! noro       59:  #   endif
1.1       ohara      60: +    GC_timerstop();
                     61:  }
                     62:
1.5     ! noro       63:  /* If stop_func == 0 then GC_default_stop_func is used instead.         */
        !            64: @@ -1169,6 +1175,9 @@
1.1       ohara      65:          if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
                     66:           GC_collect_at_heapsize = (word)(-1);
                     67:  #     endif
1.3       ohara      68: +#if defined(VISUAL)
1.1       ohara      69: +    SendHeapSize();
                     70: +#endif
                     71:      return(TRUE);
                     72:  }
                     73:
1.5     ! noro       74: @@ -1278,6 +1287,21 @@
        !            75:      GC_bool retry = FALSE;
1.1       ohara      76:
                     77:      if (gran == 0) return(0);
1.2       ohara      78: +#if defined(_MSC_VER)
1.1       ohara      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
1.5     ! noro       93:
1.1       ohara      94:      while (*flh == 0) {
                     95:        ENTER_GC();
1.5     ! noro       96: diff -urN gc-7.2alpha4.org/reclaim.c gc-7.2alpha4/reclaim.c
        !            97: --- gc-7.2alpha4.org/reclaim.c 2010-01-04 17:04:36.987052700 -0500
        !            98: +++ gc-7.2alpha4/reclaim.c     2010-01-04 17:06:56.439052700 -0500
        !            99: @@ -572,6 +572,7 @@
1.1       ohara     100:
                    101:      if (GC_print_stats == VERBOSE)
                    102:        GET_TIME(start_time);
                    103: +    GC_timerstart();
1.5     ! noro      104:  #   endif
        !           105:
1.1       ohara     106:      for (kind = 0; kind < GC_n_kinds; kind++) {
1.5     ! noro      107: @@ -596,6 +597,7 @@
1.1       ohara     108:          }
                    109:      }
1.5     ! noro      110:  #   ifndef SMALL_CONFIG
1.1       ohara     111: +    GC_timerstop();
                    112:      if (GC_print_stats == VERBOSE) {
                    113:        GET_TIME(done_time);
                    114:        GC_log_printf("Disposing of reclaim lists took %lu msecs\n",
1.5     ! noro      115: diff -urN gc-7.2alpha4.org/misc.c gc-7.2alpha4/misc.c
        !           116: --- gc-7.2alpha4.org/misc.c    2010-01-04 17:07:45.244052700 -0500
        !           117: +++ gc-7.2alpha4/misc.c        2010-01-04 17:13:03.397052700 -0500
        !           118: @@ -128,6 +128,93 @@
        !           119:  GC_INNER long GC_large_alloc_warn_interval = GC_LARGE_ALLOC_WARN_INTERVAL;
        !           120:                          /* Interval between unsuppressed warnings.      */
1.2       ohara     121:
                    122: +#include <time.h>
                    123: +
                    124: +#if defined(_MSC_VER)
                    125: +#include <windows.h>
                    126: +
                    127: +static double get_clock()
                    128: +{
                    129: +      static int initialized = 0;
                    130: +      static int is_winnt = 0;
                    131: +      static HANDLE curproc;
                    132: +
                    133: +      if ( !initialized ) {
                    134: +              OSVERSIONINFO vinfo;
                    135: +
                    136: +              curproc = GetCurrentProcess();
                    137: +              vinfo.dwOSVersionInfoSize = sizeof(vinfo);
                    138: +              GetVersionEx(&vinfo);
                    139: +              if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
                    140: +                      is_winnt = 1;
                    141: +              else
                    142: +                      is_winnt = 0;
                    143: +      }
                    144: +      if ( is_winnt ) {
                    145: +              FILETIME c,e,k,u;
                    146: +
                    147: +              GetProcessTimes(curproc,&c,&e,&k,&u);
                    148: +              return ((double)k.dwLowDateTime+(double)u.dwLowDateTime
                    149: +                      +4294967296.0*((double)k.dwHighDateTime+(double)u.dwHighDateTime))/10000000.0;
                    150: +      } else
                    151: +//            return (double)clock()/(double)CLOCKS_PER_SEC;
                    152: +              return ((double)GetTickCount())/1000.0;
                    153: +}
                    154: +
                    155: +#elif defined(THINK_C) || defined(__MWERKS__) || defined(MSWIN32)
                    156: +
                    157: +static double get_clock()
                    158: +{
                    159: +      clock_t c;
                    160: +
                    161: +      c = clock();
                    162: +      return (double)c/(double)CLOCKS_PER_SEC;
                    163: +}
                    164: +
                    165: +#elif defined(_PA_RISC1_1) || defined(__svr4__) || defined(__CYGWIN__)
                    166: +
1.4       noro      167: +#include <sys/times.h>
1.2       ohara     168: +#include <limits.h>
                    169: +
                    170: +static double get_clock()
                    171: +{
                    172: +      struct tms buf;
                    173: +
                    174: +      times(&buf);
                    175: +      return (double)(buf.tms_utime+buf.tms_stime)/(double)CLK_TCK;
                    176: +}
                    177: +
                    178: +#else
                    179: +
                    180: +#include <sys/time.h>
                    181: +#include <sys/resource.h>
                    182: +
                    183: +static double get_clock()
                    184: +{
                    185: +      int tv_sec,tv_usec;
                    186: +      struct rusage ru;
                    187: +
                    188: +      getrusage(RUSAGE_SELF,&ru);
                    189: +      tv_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
                    190: +      tv_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
                    191: +      return (double)tv_sec+(double)tv_usec/(double)1000000;
                    192: +}
                    193: +#endif
                    194: +
                    195: +static double gctime, gcstart;
                    196: +
                    197: +void GC_timerstart() {
                    198: +      gcstart = get_clock();
                    199: +}
                    200: +
                    201: +void GC_timerstop() {
                    202: +      gctime += get_clock() - gcstart;
                    203: +}
                    204: +
                    205: +double GC_get_gctime() {
                    206: +      return gctime;
                    207: +}
                    208: +
                    209:  /*ARGSUSED*/
1.5     ! noro      210:  STATIC void * GC_CALLBACK GC_default_oom_fn(size_t bytes_requested)
1.2       ohara     211:  {

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>