[BACK]Return to solaris_threads.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gc

Diff for /OpenXM_contrib/gc/Attic/solaris_threads.c between version 1.1 and 1.1.1.2

version 1.1, 1999/11/27 10:58:33 version 1.1.1.2, 2000/04/14 11:07:59
Line 616  GC_thread GC_lookup_thread(thread_t id)
Line 616  GC_thread GC_lookup_thread(thread_t id)
     return(p);      return(p);
 }  }
   
   # define MAX_ORIG_STACK_SIZE (8 * 1024 * 1024)
   
   word GC_get_orig_stack_size() {
       struct rlimit rl;
       static int warned = 0;
       int result;
   
       if (getrlimit(RLIMIT_STACK, &rl) != 0) ABORT("getrlimit failed");
       result = (word)rl.rlim_cur & ~(HBLKSIZE-1);
       if (result > MAX_ORIG_STACK_SIZE) {
           if (!warned) {
               WARN("Large stack limit(%ld): only scanning 8 MB", result);
               warned = 1;
           }
           result = MAX_ORIG_STACK_SIZE;
       }
       return result;
   }
   
 /* Notify dirty bit implementation of unused parts of my stack. */  /* Notify dirty bit implementation of unused parts of my stack. */
 /* Caller holds allocation lock.                                */  /* Caller holds allocation lock.                                */
 void GC_my_stack_limits()  void GC_my_stack_limits()
Line 628  void GC_my_stack_limits()
Line 647  void GC_my_stack_limits()
   
     if (stack_size == 0) {      if (stack_size == 0) {
       /* original thread */        /* original thread */
         struct rlimit rl;  
   
         if (getrlimit(RLIMIT_STACK, &rl) != 0) ABORT("getrlimit failed");  
         /* Empirically, what should be the stack page with lowest       */          /* Empirically, what should be the stack page with lowest       */
         /* address is actually inaccessible.                            */          /* address is actually inaccessible.                            */
         stack_size = ((word)rl.rlim_cur & ~(HBLKSIZE-1)) - GC_page_sz;          stack_size = GC_get_orig_stack_size() - GC_page_sz;
         stack = GC_stackbottom - stack_size + GC_page_sz;          stack = GC_stackbottom - stack_size + GC_page_sz;
     } else {      } else {
         stack = me -> stack;          stack = me -> stack;
Line 671  void GC_push_all_stacks()
Line 687  void GC_push_all_stacks()
             top = p -> stack + p -> stack_size;              top = p -> stack + p -> stack_size;
         } else {          } else {
             /* The original stack. */              /* The original stack. */
             if (getrlimit(RLIMIT_STACK, &rl) != 0) ABORT("getrlimit failed");              bottom = GC_stackbottom - GC_get_orig_stack_size() + GC_page_sz;
             bottom = GC_stackbottom - rl.rlim_cur + GC_page_sz;  
             top = GC_stackbottom;              top = GC_stackbottom;
         }          }
         if ((word)sp > (word)bottom && (word)sp < (word)top) bottom = sp;          if ((word)sp > (word)bottom && (word)sp < (word)top) bottom = sp;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.2

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