[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.3

version 1.1, 1999/11/27 10:58:33 version 1.1.1.3, 2000/12/01 14:48:25
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 645  void GC_my_stack_limits()
Line 661  void GC_my_stack_limits()
 }  }
   
   
 /* We hold allocation lock.  We assume the world is stopped.    */  /* We hold allocation lock.  Should do exactly the right thing if the   */
   /* world is stopped.  Should not fail if it isn't.                      */
 void GC_push_all_stacks()  void GC_push_all_stacks()
 {  {
     register int i;      register int i;
Line 671  void GC_push_all_stacks()
Line 688  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;
Line 885  GC_thr_create(void *stack_base, size_t stack_size,
Line 901  GC_thr_create(void *stack_base, size_t stack_size,
     }      }
     GC_multithreaded++;      GC_multithreaded++;
     if (stack == 0) {      if (stack == 0) {
         if (stack_size == 0) stack_size = GC_min_stack_sz;          if (stack_size == 0) stack_size = 1024*1024;
         stack = (void *)GC_stack_alloc(&stack_size);          stack = (void *)GC_stack_alloc(&stack_size);
         if (stack == 0) {          if (stack == 0) {
             GC_multithreaded--;              GC_multithreaded--;

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

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