OSDN Git Service

2002-08-23 Adam Megacz <adam@xwt.org>
[pf3gnuchains/gcc-fork.git] / boehm-gc / linux_threads.c
index 0bc0f13..c968e7c 100644 (file)
@@ -231,15 +231,16 @@ static void return_freelists(ptr_t *fl, ptr_t *gfl)
        nwords = i * (GRANULARITY/sizeof(word));
         qptr = fl + i; 
        q = *qptr;
-       if ((word)q < HBLKSIZE) continue;
-       if (gfl[nwords] == 0) {
+       if ((word)q >= HBLKSIZE) {
+         if (gfl[nwords] == 0) {
            gfl[nwords] = q;
-       } else {
+         } else {
            /* Concatenate: */
            for (; (word)q >= HBLKSIZE; qptr = &(obj_link(q)), q = *qptr);
            GC_ASSERT(0 == q);
            *qptr = gfl[nwords];
            gfl[nwords] = fl[i];
+         }
        }
        /* Clear fl[i], since the thread structure may hang around.     */
        /* Do it in a way that is likely to trap if we access it.       */
@@ -412,6 +413,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes,
            /* A memory barrier is probably never needed, since the     */
            /* action of stopping this thread will cause prior writes   */
            /* to complete.                                             */
+           GC_ASSERT(((void * volatile *)result)[1] == 0); 
            *(void * volatile *)result = ptr_to_struct_containing_descr; 
            return result;
        } else if ((word)my_entry - 1 < DIRECT_GRANULES) {
@@ -544,7 +546,7 @@ static void start_mark_threads()
          ABORT("pthread_attr_getstacksize failed\n");
        if (old_size < MIN_STACK_SIZE) {
          if (pthread_attr_setstacksize(&attr, MIN_STACK_SIZE) != 0)
-           ABORT("pthread_attr_getstacksize failed\n");
+                 ABORT("pthread_attr_setstacksize failed\n");
        }
       }
 #   endif /* HPUX */