]> granicus.if.org Git - gc/commitdiff
2009-06-04 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
authorhboehm <hboehm>
Fri, 5 Jun 2009 03:59:36 +0000 (03:59 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:45 +0000 (21:06 +0400)
(diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
partly)
        * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
        outdated comment about disabling signals.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Ditto.
        * os_dep.c: Ditto.
        * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
        Add ARGSUSED tag.
        * pthread_stop_world.c (GC_suspend_handler,
        GC_suspend_handler_inner): Ditto.
        * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
        * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
        switch branch to suppress compiler warning.
        * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
        * include/private/darwin_semaphore.h (sem_init): Ditto.
        * include/javaxfc.h: Replace "GC_H" with "_GC_H".
        * include/private/dbg_mlc.h (GC_has_other_debug_info,
        GC_store_debug_info): Replace K&R-style function prototypes with ANSI
        C one.
        * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
        GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
        * include/private/pthread_support.h (GC_stop_init): Ditto.
        * include/private/gcconfig.h: Refine comment about setting
        GC_stackbottom.
        * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
        "right" places.
        * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
        for "stack_end" field.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
        * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
        GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
        * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
        format specifier (should be word-compliant, "%p" is used w/o "0x").
        * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
        * os_dep.c (GC_dirty_init): Append new-line to printf messages.
        * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
        * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
        * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
        as STATIC.
        * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
        "thread_blocked" is not set for the current thread.
        * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
        * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
        suppress compiler warning.

13 files changed:
ChangeLog
dbg_mlc.c
dyn_load.c
include/javaxfc.h
include/private/darwin_semaphore.h
include/private/dbg_mlc.h
include/private/gcconfig.h
include/private/pthread_support.h
mallocx.c
os_dep.c
pthread_stop_world.c
real_malloc.c
reclaim.c

index d3eebe87059333ae31e580a0b0bb76eb72609478..31e7980683b26d86fdc4d32290d033f8cf29d73e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2009-06-04  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
+       (diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
+       diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
+       partly)
+        * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
+        outdated comment about disabling signals.
+        * mallocx.c (GC_malloc_uncollectable,
+        GC_malloc_atomic_uncollectable): Ditto.
+        * os_dep.c: Ditto.
+        * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
+        Add ARGSUSED tag.
+        * pthread_stop_world.c (GC_suspend_handler,
+        GC_suspend_handler_inner): Ditto.
+        * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
+        * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
+        switch branch to suppress compiler warning.
+        * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
+        * include/private/darwin_semaphore.h (sem_init): Ditto.
+        * include/javaxfc.h: Replace "GC_H" with "_GC_H".
+        * include/private/dbg_mlc.h (GC_has_other_debug_info,
+        GC_store_debug_info): Replace K&R-style function prototypes with ANSI
+        C one.
+        * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
+        GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
+        * include/private/pthread_support.h (GC_stop_init): Ditto.
+        * include/private/gcconfig.h: Refine comment about setting
+        GC_stackbottom.
+        * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
+        "right" places.
+        * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
+        for "stack_end" field.
+        * mallocx.c (GC_malloc_uncollectable,
+        GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
+        * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
+        GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
+        * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
+        format specifier (should be word-compliant, "%p" is used w/o "0x").
+        * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
+        * os_dep.c (GC_dirty_init): Append new-line to printf messages.
+        * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
+        * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
+        * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
+        as STATIC.
+        * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
+        "thread_blocked" is not set for the current thread.
+        * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
+        * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
+        suppress compiler warning.
+       
 2009-06-02  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
        (adding last bit of diff86_cvs)
        * tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.
index 70137d4c1ad75a1303e9ef2b500c783a2efffa56..dfc13b9af7e25d9c12f693b4b27370a2328ab8aa 100644 (file)
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -246,9 +246,6 @@ ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string, word integer)
     register word * result = (word *)((oh *)p + 1);
     DCL_LOCK_STATE;
     
-    /* There is some argument that we should dissble signals here.     */
-    /* But that's expensive.  And this way things should only appear   */
-    /* inconsistent while we're in the handler.                                */
     LOCK();
     GC_ASSERT(GC_size(p) >= sizeof(oh) + sz);
     GC_ASSERT(!(SMALL_OBJ(sz) && CROSSES_HBLK(p, sz)));
@@ -278,9 +275,6 @@ STATIC ptr_t GC_store_debug_info_inner(ptr_t p, word sz, char *string,
 {
     register word * result = (word *)((oh *)p + 1);
     
-    /* There is some argument that we should disable signals here.     */
-    /* But that's expensive.  And this way things should only appear   */
-    /* inconsistent while we're in the handler.                                */
     GC_ASSERT(GC_size(p) >= sizeof(oh) + sz);
     GC_ASSERT(!(SMALL_OBJ(sz) && CROSSES_HBLK(p, sz)));
 #   ifdef KEEP_BACK_PTRS
@@ -615,10 +609,12 @@ GC_API void * GC_CALL GC_debug_malloc_stubborn(size_t lb, GC_EXTRA_PARAMS)
     return GC_debug_malloc(lb, OPT_RA s, i);
 }
 
+/*ARGSUSED*/
 GC_API void GC_CALL GC_debug_change_stubborn(void *p)
 {
 }
 
+/*ARGSUSED*/
 GC_API void GC_CALL GC_debug_end_stubborn_change(void *p)
 {
 }
@@ -711,7 +707,7 @@ GC_API void GC_CALL GC_debug_free(void * p)
     }
     if ((ptr_t)p - (ptr_t)base != sizeof(oh)) {
         GC_err_printf(
-                 "GC_debug_free called on pointer %p wo debugging info\n", p);
+                "GC_debug_free called on pointer %p w/o debugging info\n", p);
     } else {
 #     ifndef SHORT_DBG_HDRS
         clobbered = GC_check_annotated_obj((oh *)base);
@@ -790,7 +786,7 @@ GC_API void * GC_CALL GC_debug_realloc(void * p, size_t lb, GC_EXTRA_PARAMS)
     }
     if ((ptr_t)p - (ptr_t)base != sizeof(oh)) {
         GC_err_printf(
-               "GC_debug_realloc called on pointer %p wo debugging info\n", p);
+              "GC_debug_realloc called on pointer %p w/o debugging info\n", p);
         return(GC_realloc(p, lb));
     }
     hhdr = HDR(base);
@@ -815,6 +811,7 @@ GC_API void * GC_CALL GC_debug_realloc(void * p, size_t lb, GC_EXTRA_PARAMS)
        break;
 #    endif
       default:
+        result = NULL; /* initialized to prevent warning. */
         GC_err_printf("GC_debug_realloc: encountered bad kind\n");
         ABORT("bad kind");
     }
index d443ff1efe885dbdbf5863c06f32113accfff33d..f84311d6830b1332ef59dc54a87dbefd811a8612 100644 (file)
@@ -1239,7 +1239,7 @@ void GC_init_dyld() {
 #   endif
       
       if(!_dyld_bind_fully_image_containing_address((unsigned long*)GC_malloc))
-        GC_abort("_dyld_bind_fully_image_containing_address failed");
+        ABORT("_dyld_bind_fully_image_containing_address failed");
     }
 
 }
index ac8d81abd8fae00854693acbf4a03925828b9b67..46643e93c3881e12b0602ddcd4efc76c4d83de6b 100644 (file)
@@ -1,4 +1,4 @@
-# ifndef GC_H
+# ifndef _GC_H
 #   include "gc.h"
 # endif
 
index 0f43982d5c1e1b3af86126400ab5b281aecfcd20..9baceebea1dc140b531850b2af6cf318ea2b3fd8 100644 (file)
@@ -21,7 +21,7 @@ typedef struct {
 static int sem_init(sem_t *sem, int pshared, int value) {
     int ret;
     if(pshared)
-        GC_abort("sem_init with pshared set");
+        ABORT("sem_init with pshared set");
     sem->value = value;
     
     ret = pthread_mutex_init(&sem->mutex,NULL);
index 27808bda81cddf46eec565f326276889314a36ac..34443270d2f33d05ead7955e636fb4cbb83b5a11 100644 (file)
@@ -161,7 +161,7 @@ typedef struct {
 #ifdef SHORT_DBG_HDRS
 # define GC_has_other_debug_info(p) TRUE
 #else
-  GC_bool GC_has_other_debug_info(/* p */);
+  GC_bool GC_has_other_debug_info(ptr_t p);
 #endif
 
 #if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
@@ -173,6 +173,6 @@ typedef struct {
 
 /* Store debugging info into p.  Return displaced pointer. */
 /* Assumes we don't hold allocation lock.                 */
-ptr_t GC_store_debug_info(/* p, sz, string, integer */);
+ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str, word integer);
 
 #endif /* _DBG_MLC_H */
index be3d5ec3e0b8e3c2c6d6418dbfda2a2f7164d4ec..0aea9a61464d5ba7f80728a2aef54d7d838e9107 100644 (file)
  *    easily accomplished by introducing a new main program, setting
  *    GC_stackbottom to the address of a local variable, and then calling
  *    the original main program.  The new main program would read something
- *    like:
+ *    like (provided real_main() is not inlined by the compiler):
  *
  *             # include "gc_private.h"
  *
 #           define DYNAMIC_LOADING
 #       endif
         extern char etext[];
-        extern char * GC_FreeBSDGetDataStart();
+        ptr_t GC_FreeBSDGetDataStart(size_t max_page_size, ptr_t etext_addr);
 #       define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
 #   endif
 #   ifdef NETBSD
 #          define DYNAMIC_LOADING
 #      endif
        extern char etext[];
-       extern char * GC_FreeBSDGetDataStart();
+        ptr_t GC_FreeBSDGetDataStart(size_t max_page_size, ptr_t etext_addr);
 #      define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
 #   endif
 #   ifdef NETBSD
 # endif
 
 # if !defined(FIXUP_POINTER) && defined(POINTER_MASK)
-#   define FIXUP_POINTER(p) (p) = ((p) & (POINTER_MASK) << POINTER_SHIFT)
+#   define FIXUP_POINTER(p) (p = ((p) & POINTER_MASK) << POINTER_SHIFT)
 # endif
 
 # if defined(FIXUP_POINTER)
        /* does.                                                        */
        struct hblk;    /* See gc_priv.h.       */
 # if defined(PCR)
-    char * real_malloc();
+    char * real_malloc(size_t bytes);
 #   define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \
                                          + GC_page_size-1)
 # elif defined(OS2)
 #   define GET_MEM(bytes) HBLKPTR((size_t) calloc(1, (size_t)bytes + GC_page_size) \
                                                     + GC_page_size-1)
 # elif defined(MSWIN32)
-    extern ptr_t GC_win32_get_mem();
+    ptr_t GC_win32_get_mem(GC_word bytes);
 #   define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
 # elif defined(MACOS)
 #   if defined(USE_TEMPORARY_MEMORY)
                                NewPtrClear(bytes + GC_page_size) + GC_page_size-1)
 #   endif
 # elif defined(MSWINCE)
-    extern ptr_t GC_wince_get_mem();
+    ptr_t GC_wince_get_mem(GC_word bytes);
 #   define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
 # elif defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
     extern void *GC_amiga_get_mem(size_t size);
                          GC_amiga_get_mem((size_t)bytes + GC_page_size) \
                          + GC_page_size-1)
 # else
-    extern ptr_t GC_unix_get_mem();
+    ptr_t GC_unix_get_mem(GC_word bytes);
 #   define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
 # endif
 
index 77f1ad1a90fadc4686fb55b3fdfa1f39c40b3f8e..43248bfdc7376a03fcccb473c8a3f7c80f38e558 100644 (file)
@@ -49,7 +49,8 @@ typedef struct GC_Thread_Rep {
                                /* has set its sp value.  Thus it does  */
                                /* not need to be sent a signal to stop */
                                /* it.                                  */
-    ptr_t stack_end;           /* Cold end of the stack.               */
+    ptr_t stack_end;           /* Cold end of the stack (except for    */
+                               /* main thread).                        */
 #   ifdef IA64
        ptr_t backing_store_end;
        ptr_t backing_store_ptr;
@@ -73,7 +74,7 @@ extern GC_bool GC_thr_initialized;
 
 GC_thread GC_lookup_thread(pthread_t id);
 
-void GC_stop_init();
+void GC_stop_init(void);
 
 extern GC_bool GC_in_thread_creation;
        /* We may currently be in thread creation or destruction.       */
index 6aa572b8021387d1ea8c46277b925402d74ebe29..54ae1c4aa7d95ebb3d85022d8fa7d3295ea7eec2 100644 (file)
--- a/mallocx.c
+++ b/mallocx.c
@@ -453,7 +453,6 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb)
        opp = &(GC_uobjfreelist[lg]);
        LOCK();
         if( (op = *opp) != 0 ) {
-            /* See above comment on signals.   */
             *opp = obj_link(op);
             obj_link(op) = 0;
             GC_bytes_allocd += GRANULES_TO_BYTES(lg);
@@ -476,7 +475,7 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb)
         if (0 == op) return(0);
        
        GC_ASSERT(((word)op & (HBLKSIZE - 1)) == 0); /* large block */
-       hhdr = HDR((struct hbklk *)op);
+       hhdr = HDR(op);
        /* We don't need the lock here, since we have an undisguised    */
        /* pointer.  We do need to hold the lock while we adjust        */
        /* mark bits.                                                   */
@@ -541,7 +540,6 @@ GC_API void * GC_CALL GC_malloc_atomic_uncollectable(size_t lb)
        opp = &(GC_auobjfreelist[lg]);
        LOCK();
         if( (op = *opp) != 0 ) {
-            /* See above comment on signals.   */
             *opp = obj_link(op);
             obj_link(op) = 0;
             GC_bytes_allocd += GRANULES_TO_BYTES(lg);
@@ -561,7 +559,7 @@ GC_API void * GC_CALL GC_malloc_atomic_uncollectable(size_t lb)
         if (0 == op) return(0);
 
        GC_ASSERT(((word)op & (HBLKSIZE - 1)) == 0);
-       hhdr = HDR((struct hbklk *)op);
+       hhdr = HDR(op);
        
        LOCK();
        set_mark_bit_from_hdr(hhdr, 0); /* Only object. */
index 97c272e3facc10c888c486dbec897b58e9d8459b..e3b98b360e202845b4ea0dc32569268ac0cbbb34 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -1838,9 +1838,14 @@ SYSTEM_INFO GC_sysinfo;
 
 word GC_n_heap_bases = 0;
 
-DWORD GC_mem_top_down = 0; /* Change to MEM_TOP_DOWN  for better 64-bit */
+#ifdef GC_USE_MEM_TOP_DOWN
+  STATIC DWORD GC_mem_top_down = MEM_TOP_DOWN;
+                          /* Use GC_USE_MEM_TOP_DOWN for better 64-bit */
                           /* testing.  Otherwise all addresses tend to */
                           /* end up in first 4GB, hiding bugs.         */
+#else
+  STATIC DWORD GC_mem_top_down = 0;
+#endif
 
 ptr_t GC_win32_get_mem(word bytes)
 {
@@ -2309,7 +2314,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
           if ( i != 0 && last_warned != start && warn_count++ < 5) {
             last_warned = start;
             WARN(
-              "GC_gww_read_dirty unexpectedly failed at %ld: "
+              "GC_gww_read_dirty unexpectedly failed at %p: "
               "Falling back to marking all pages dirty\n", start);
           }
           for (j = 0; j < nblocks; ++j) {
@@ -2364,8 +2369,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 
 # ifdef DEFAULT_VDB
 
-/* All of the following assume the allocation lock is held, and        */
-/* signals are disabled.                                       */
+/* All of the following assume the allocation lock is held.    */
 
 /* The client asserts that unallocated pages in the heap are never     */
 /* written.                                                            */
@@ -2859,7 +2863,7 @@ void GC_dirty_init(void)
        GC_old_segv_handler_used_si = FALSE;
       }
       if (GC_old_segv_handler == (SIG_HNDLR_PTR)SIG_IGN) {
-       GC_err_printf("Previously ignored segmentation violation!?");
+       GC_err_printf("Previously ignored segmentation violation!?\n");
        GC_old_segv_handler = (SIG_HNDLR_PTR)SIG_DFL;
       }
       if (GC_old_segv_handler != (SIG_HNDLR_PTR)SIG_DFL) {
@@ -2877,7 +2881,7 @@ void GC_dirty_init(void)
        GC_old_bus_handler_used_si = FALSE;
       }
       if (GC_old_bus_handler == (SIG_HNDLR_PTR)SIG_IGN) {
-            GC_err_printf("Previously ignored bus error!?");
+            GC_err_printf("Previously ignored bus error!?\n");
             GC_old_bus_handler = (SIG_HNDLR_PTR)SIG_DFL;
       }
       if (GC_old_bus_handler != (SIG_HNDLR_PTR)SIG_DFL) {
@@ -3578,7 +3582,7 @@ static void *GC_mprotect_thread(void *arg)
            /* This will fail if the thread dies, but the thread */
            /* shouldn't die... */
 #           ifdef BROKEN_EXCEPTION_HANDLING
-             GC_err_printf("mach_msg failed with %d %s while sending"
+             GC_err_printf("mach_msg failed with %d %s while sending "
                            "exc reply\n", (int)r,mach_error_string(r));
 #           else
              ABORT("mach_msg failed while sending exception reply");
@@ -3845,7 +3849,7 @@ catch_exception_raise(mach_port_t exception_port, mach_port_t thread,
        }
        if(++last_fault_count < 32) {
          if(last_fault_count == 1)
-           WARN("Ignoring KERN_PROTECTION_FAILURE at %lx\n", (GC_word)addr);
+           WARN("Ignoring KERN_PROTECTION_FAILURE at %p\n", addr);
          return KERN_SUCCESS;
        }
 
@@ -4017,7 +4021,7 @@ void GC_save_callers (struct callinfo info[NFRAMES])
     }
     GC_in_save_callers = TRUE;
 # endif
-  GC_ASSERT(sizeof(struct callinfo) == sizeof(void *));
+  GC_STATIC_ASSERT(sizeof(struct callinfo) == sizeof(void *));
   npcs = backtrace((void **)tmp_info, NFRAMES + IGNORE_FRAMES);
   BCOPY(tmp_info+IGNORE_FRAMES, info, (npcs - IGNORE_FRAMES) * sizeof(void *));
   for (i = npcs - IGNORE_FRAMES; i < NFRAMES; ++i) info[i].ci_pc = 0;
index 737bbfd257737c6c13e86eef62accc808999b2be..ae1d225a94c02d298487653e60d3a34b131d8a7a 100644 (file)
@@ -75,9 +75,9 @@ volatile AO_t GC_world_is_stopped = FALSE;
                        /* stopped).                                         */
 
 #ifdef GC_OSF1_THREADS
-  GC_bool GC_retry_signals = TRUE;
+  STATIC GC_bool GC_retry_signals = TRUE;
 #else
-  GC_bool GC_retry_signals = FALSE;
+  STATIC GC_bool GC_retry_signals = FALSE;
 #endif
 
 /*
@@ -104,19 +104,20 @@ volatile AO_t GC_world_is_stopped = FALSE;
 #  endif
 #endif
 
-sem_t GC_suspend_ack_sem;
+STATIC sem_t GC_suspend_ack_sem;
 
 #ifdef GC_NETBSD_THREADS
 # define GC_NETBSD_THREADS_WORKAROUND
   /* It seems to be necessary to wait until threads have restarted.    */
   /* But it is unclear why that is the case.                           */
-  sem_t GC_restart_ack_sem;
+  STATIC sem_t GC_restart_ack_sem;
 #endif
 
 STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context);
 
 #if defined(IA64) || defined(HP_PA) || defined(M68K)
 #ifdef SA_SIGINFO
+/*ARGSUSED*/
 STATIC void GC_suspend_handler(int sig, siginfo_t *info, void *context)
 #else
 STATIC void GC_suspend_handler(int sig)
@@ -144,6 +145,7 @@ STATIC void GC_suspend_handler(int sig)
 }
 #endif
 
+/*ARGSUSED*/
 STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context)
 {
     int sig = (int)(word)sig_arg;
@@ -167,8 +169,8 @@ STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context)
     if (me -> stop_info.last_stop_count == my_stop_count) {
        /* Duplicate signal.  OK if we are retrying.    */
        if (!GC_retry_signals) {
-           WARN("Duplicate suspend signal in thread %lx\n",
-                pthread_self());
+           WARN("Duplicate suspend signal in thread %p\n",
+                (word)pthread_self());
        }
        return;
     }
@@ -264,6 +266,7 @@ void GC_push_all_stacks(void)
         if (p -> flags & FINISHED) continue;
        ++nthreads;
         if (THREAD_EQUAL(p -> id, me)) {
+           GC_ASSERT(!p->thread_blocked);
 #          ifdef SPARC
                lo = (ptr_t)GC_save_regs_in_stack();
 #          else
index 85befdcbaafde6d1e0583ea0e7ab6fbebd92823d..01be5f0fbb74fdc72b352888d42a5a109b05aa09 100644 (file)
@@ -27,5 +27,12 @@ void * real_malloc(size_t size)
 {
     return(malloc(size));
 }
+
+# else
+
+extern int GC_quiet;
+       /* ANSI C doesn't allow translation units to be empty.  */
+       /* So we guarantee this one is nonempty.                */
+
 #endif /* PCR */
 
index 220caf83a788d2b74c9cf68b58b374229445110c..12afa91822094eea57551293961eeca5846c1560 100644 (file)
--- a/reclaim.c
+++ b/reclaim.c
@@ -570,7 +570,7 @@ GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old)
     struct hblk ** rlp;
     struct hblk ** rlh;
 #   ifndef SMALL_CONFIG
-      CLOCK_TYPE start_time;
+      CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
       CLOCK_TYPE done_time;
        
       if (GC_print_stats == VERBOSE)